* (bug 26449) Keep underlines from headings outside of tables and thumbs by
adding overflow:hidden to h1,h2,h3,h4,h5,h6 (also fixes editsection bunching).
* (bug 26708) Remove background-color:white from tables in Monobook and Vector.
+* (bug 26781) {{PAGENAME}} and related parser functions escape their output better
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
* Escapes the given text so that it may be output using addWikiText()
* without any linking, formatting, etc. making its way through. This
* is achieved by substituting certain characters with HTML entities.
- * As required by the callers, <nowiki> is not used. It currently does
- * not filter out characters which have special meaning only at the
- * start of a line, such as "*".
+ * As required by the callers, <nowiki> is not used.
*
* @param $text String: text to be escaped
*/
function wfEscapeWikiText( $text ) {
- $text = str_replace(
- array( '[', '|', ']', '\'', 'ISBN ',
- 'RFC ', '://', "\n=", '{{', '}}' ),
- array( '[', '|', ']', ''', 'ISBN ',
- 'RFC ', '://', "\n=", '{{', '}}' ),
- htmlspecialchars( $text )
- );
- return $text;
+ $text = strtr( "\n$text", array(
+ '"' => '"', '&' => '&', "'" => ''', '<' => '<',
+ '=' => '=', '>' => '>', '[' => '[', ']' => ']',
+ '{' => '{', '|' => '|', '}' => '}',
+ "\n#" => "\n#", "\n*" => "\n*",
+ "\n:" => "\n:", "\n;" => "\n;",
+ '://' => '://', 'ISBN ' => 'ISBN ', 'RFC ' => 'RFC ',
+ ) );
+ return substr( $text, 1 );
}
/**