X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiFormatJson.php;h=966e82dc6aaed240b05159467e4fdb161d46adf4;hb=6d9946294737f21d939c1addf81496ed679beb24;hp=ce8656e221e1cd6f4c2fb6dcddcafef7b480c011;hpb=fbcfc191b14a427f5d245cded17dc1108023414b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php index ce8656e221..966e82dc6a 100644 --- a/includes/api/ApiFormatJson.php +++ b/includes/api/ApiFormatJson.php @@ -67,6 +67,16 @@ class ApiFormatJson extends ApiFormatBase { $this->getIsHtml(), $params['utf8'] ? FormatJson::ALL_OK : FormatJson::XMLMETA_OK ); + + // Bug 66776: wfMangleFlashPolicy() is needed to avoid a nasty bug in + // Flash, but what it does isn't friendly for the API, so we need to + // work around it. + if ( preg_match( '/\<\s*cross-domain-policy\s*\>/i', $json ) ) { + $json = preg_replace( + '/\<(\s*cross-domain-policy\s*)\>/i', '\\u003C$1\\u003E', $json + ); + } + $callback = $params['callback']; if ( $callback !== null ) { $callback = preg_replace( "/[^][.\\'\\\"_A-Za-z0-9]/", '', $callback );