r5234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5233‎ | r5234 | r5235 >
Date:05:53, 15 September 2004
Author:jeluf
Status:old
Tags:
Comment:
BUG#487 make regex not-so-greedy. If anchored to end-of-line, several lines are eaten if
there is text following the comment
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -1784,7 +1784,7 @@
17851785 $htmlattrs = $this->getHTMLattrs () ;
17861786
17871787 # Remove HTML comments
1788 - $text = preg_replace( '/(\\n *<!--.*--> *(?=\\n)|<!--.*-->)/sU', '$2', $text );
 1788+ $text = preg_replace( '/(\\n *<!--.*--> *|<!--.*?-->)/sU', '', $text );
17891789
17901790 $bits = explode( '<', $text );
17911791 $text = array_shift( $bits );

Follow-up revisions

RevisionCommit summaryAuthorDate
r5320BUG#487 Use Wil's custom function to replace HTML comments instead of...jeluf06:17, 20 September 2004

Status & tagging log