From: Bryan Tong Minh Date: Sat, 5 Apr 2008 18:52:33 +0000 (+0000) Subject: (bug 12136) Extend allowed characters in JSON callback to ][.'"_A-Za-z0-9 X-Git-Tag: 1.31.0-rc.0~48602 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=02387af88e53d5f9714cada80ef9ebd1fce8fdee;p=lhc%2Fweb%2Fwiklou.git (bug 12136) Extend allowed characters in JSON callback to ][.'"_A-Za-z0-9 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 35e1334746..3684ffb057 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -193,6 +193,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13606) Added archivename to iiprop * (bug 11633) Explicitly convert redirect titles to strings due to PHP's very weak typing on array keys. +* (bug 12136) Extend allowed characters in JSON callback to ][.'"_A-Za-z0-9 === Languages updated in 1.13 === diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php index 22ca6588f2..32d29ede97 100644 --- a/includes/api/ApiFormatJson.php +++ b/includes/api/ApiFormatJson.php @@ -54,7 +54,7 @@ class ApiFormatJson extends ApiFormatBase { $params = $this->extractRequestParams(); $callback = $params['callback']; if(!is_null($callback)) { - $prefix = ereg_replace("[^_A-Za-z0-9]", "", $callback ) . "("; + $prefix = preg_replace("/[^][.\\'\\\"_A-Za-z0-9]/", "", $callback ) . "("; $suffix = ")"; }