From: Brion Vibber Date: Wed, 19 Sep 2007 14:44:50 +0000 (+0000) Subject: Tweaks to r25923 for my own peace of mind: X-Git-Tag: 1.31.0-rc.0~51358 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=fef3b7b3c38795a2b33c9d9af5d18852e4a2ce7a;p=lhc%2Fweb%2Fwiklou.git Tweaks to r25923 for my own peace of mind: * De-escape &amp; to & rather than & to & -- guarantees that we won't leave stray &s around producing invalid or freaky output * Use == instead of = when comparing... :) --- diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index cead9fcdf3..6cfbfb174e 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -173,11 +173,12 @@ See complete documentation, or // Escape everything first for full coverage $text = htmlspecialchars($text); - /* Temporary fix for bad links in help messages. As a special case, ampersands - * are not escaped in the help message. Should be removed once we have completed - * a fully-html version of the help message. */ + /* Temporary fix for bad links in help messages. As a special case, XML-escaped + * ampersands are de-escaped one level in the help message for legibility. + * Should be removed once we have completed a fully-html version of the + * help message. */ if ( $this->mUnescapeAmps ) - $text = ereg_replace ( '&', '&', $text ); + $text = str_replace( '&amp;', '&', $text ); // encode all comments or tags as safe blue strings $text = preg_replace('/\<(!--.*?--|.*?)\>/', '<\1>', $text); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 3e8700f9b7..6a18eaf854 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -325,7 +325,7 @@ class ApiMain extends ApiBase { * not break. */ $params = $this->extractRequestParams(); $printer->setUnescapeAmps ( $this->mAction == 'help' - && $params['format'] = ApiMain::API_DEFAULT_FORMAT ); + && $params['format'] == ApiMain::API_DEFAULT_FORMAT ); $printer->execute(); $printer->closePrinter();