protected function formatHTML($text) {
// Escape everything first for full coverage
$text = htmlspecialchars($text);
-
- /* 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 = str_replace( '&', '&', $text );
// encode all comments or tags as safe blue strings
$text = preg_replace('/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text);
$text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text);
// make strings inside $ italic
$text = ereg_replace("\\$[^<>\n]+\\$", '<b><i>\\0</i></b>', $text);
+
+ /* Temporary fix for bad links in help messages. As a special case,
+ * XML-escaped metachars 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 = preg_replace( '/&(amp|quot|lt|gt);/', '&\1;', $text );
return $text;
}