Skip to content
Snippets Groups Projects
Commit 8a8aa4f7 authored by Lukas Reschke's avatar Lukas Reschke Committed by GitHub
Browse files

Add sanitizers for JSON output


Those functions set proper content-types that prevent rendering of
data. Therefore it's safe to mark them as sanitizers.

Signed-off-by: default avatarLukas Reschke <lukas@statuscode.ch>
parent 9dd27f92
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ class OC_API { ...@@ -43,6 +43,7 @@ class OC_API {
* respond to a call * respond to a call
* @param \OC\OCS\Result $result * @param \OC\OCS\Result $result
* @param string $format the format xml|json * @param string $format the format xml|json
* @psalm-taint-escape html
*/ */
public static function respond($result, $format = 'xml') { public static function respond($result, $format = 'xml') {
$request = \OC::$server->getRequest(); $request = \OC::$server->getRequest();
......
...@@ -99,6 +99,7 @@ class OC_JSON { ...@@ -99,6 +99,7 @@ class OC_JSON {
* Send json error msg * Send json error msg
* @deprecated Use a AppFramework JSONResponse instead * @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction * @suppress PhanDeprecatedFunction
* @psalm-taint-escape html
*/ */
public static function error($data = []) { public static function error($data = []) {
$data['status'] = 'error'; $data['status'] = 'error';
...@@ -110,6 +111,7 @@ class OC_JSON { ...@@ -110,6 +111,7 @@ class OC_JSON {
* Send json success msg * Send json success msg
* @deprecated Use a AppFramework JSONResponse instead * @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction * @suppress PhanDeprecatedFunction
* @psalm-taint-escape html
*/ */
public static function success($data = []) { public static function success($data = []) {
$data['status'] = 'success'; $data['status'] = 'success';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment