Merge pull request #24663 from nextcloud/sanitizers

Add sanitizers for JSON output
This commit is contained in:
Roeland Jago Douma 2020-12-14 09:11:01 +01:00 committed by GitHub
commit b2ef004969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class OC_API {
* respond to a call
* @param \OC\OCS\Result $result
* @param string $format the format xml|json
* @psalm-taint-escape html
*/
public static function respond($result, $format = 'xml') {
$request = \OC::$server->getRequest();

View File

@ -99,6 +99,7 @@ class OC_JSON {
* Send json error msg
* @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction
* @psalm-taint-escape html
*/
public static function error($data = []) {
$data['status'] = 'error';
@ -110,6 +111,7 @@ class OC_JSON {
* Send json success msg
* @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction
* @psalm-taint-escape html
*/
public static function success($data = []) {
$data['status'] = 'success';