]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add sanitizers for JSON output 24663/head
authorLukas Reschke <lukas@statuscode.ch>
Fri, 11 Dec 2020 21:23:11 +0000 (21:23 +0000)
committerGitHub <noreply@github.com>
Fri, 11 Dec 2020 21:23:11 +0000 (21:23 +0000)
Those functions set proper content-types that prevent rendering of
data. Therefore it's safe to mark them as sanitizers.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
lib/private/legacy/OC_API.php
lib/private/legacy/OC_JSON.php

index 5e4a46ab4d7468205506e10be21c08dd84b906a1..cba60826196c06c8ae7edc4df0851163a6678df5 100644 (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();
index a0b9868a023fcd12d575e262ddcd6dcf8724f81a..1597955135e195efbaaee20064c10a1f8dd7cf75 100644 (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';