// 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( '&', '&', $text );
// encode all comments or tags as safe blue strings
$text = preg_replace('/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text);
* 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();