r25938 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25937‎ | r25938 | r25939 >
Date:14:44, 19 September 2007
Author:brion
Status:old
Tags:
Comment:
Tweaks to r25923 for my own peace of mind:
* De-escape & to & rather than & to & -- guarantees that we won't leave stray &s around producing invalid or freaky output
* Use == instead of = when comparing... :)
Modified paths:
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -325,7 +325,7 @@
326326 * not break. */
327327 $params = $this->extractRequestParams();
328328 $printer->setUnescapeAmps ( $this->mAction == 'help'
329 - && $params['format'] = ApiMain::API_DEFAULT_FORMAT );
 329+ && $params['format'] == ApiMain::API_DEFAULT_FORMAT );
330330
331331 $printer->execute();
332332 $printer->closePrinter();
Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -173,11 +173,12 @@
174174 // Escape everything first for full coverage
175175 $text = htmlspecialchars($text);
176176
177 - /* Temporary fix for bad links in help messages. As a special case, ampersands
178 - * are not escaped in the help message. Should be removed once we have completed
179 - * a fully-html version of the help message. */
 177+ /* Temporary fix for bad links in help messages. As a special case, XML-escaped
 178+ * ampersands are de-escaped one level in the help message for legibility.
 179+ * Should be removed once we have completed a fully-html version of the
 180+ * help message. */
180181 if ( $this->mUnescapeAmps )
181 - $text = ereg_replace ( '&', '&', $text );
 182+ $text = str_replace( '&', '&', $text );
182183
183184 // encode all comments or tags as safe blue strings
184185 $text = preg_replace('/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text);

Follow-up revisions

RevisionCommit summaryAuthorDate
r26015Merged revisions 25932-26011 via svnmerge from...david21:05, 21 September 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r25923(bug 11296) Introduced special case pretty-printer rendering of the help docu...amidaniel22:10, 18 September 2007

Status & tagging log