(bug 8689) Use strict php comparison, so that inserting a long numeric line doesn...
authorPlatonides <platonides@users.mediawiki.org>
Fri, 28 May 2010 14:16:46 +0000 (14:16 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Fri, 28 May 2010 14:16:46 +0000 (14:16 +0000)
RELEASE-NOTES
includes/Linker.php
includes/parser/Parser.php
maintenance/ExtraParserTests.txt

index 1bec896..872486d 100644 (file)
@@ -180,6 +180,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 22541) Support image redirects when using ForeignAPIRepo.
 * (bug 22967) Make edit summary length cut-off behave correctly for 
   multibyte characters.
+* (bug 8689) Long numeric lines no longer  kill the parser.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index 8b268b5..79e417e 100644 (file)
@@ -1449,7 +1449,7 @@ class Linker {
                        $regex = $wgContLang->linkTrail();
                }
                $inside = '';
-               if ( $trail != '' ) {
+               if ( $trail !== '' ) {
                        $m = array();
                        if ( preg_match( $regex, $trail, $m ) ) {
                                $inside = $m[1];
index e14d54b..cd32813 100644 (file)
@@ -721,8 +721,9 @@ class Parser {
         */
        function doTableStuff( $text ) {
                wfProfileIn( __METHOD__ );
-
+               
                $lines = StringUtils::explode( "\n", $text );
+               $text = null;
                $out = '';
                $td_history = array(); # Is currently a td tag open?
                $last_tag_history = array(); # Save history of last lag activated (td, th or caption)
@@ -734,10 +735,11 @@ class Parser {
                foreach ( $lines as $outLine ) {
                        $line = trim( $outLine );
 
-                       if ( $line == '' ) { # empty line, go to next line
+                       if ( $line === '' ) { # empty line, go to next line                     
                                $out .= $outLine."\n";
                                continue;
                        }
+
                        $first_character = $line[0];
                        $matches = array();
 
@@ -2156,7 +2158,7 @@ class Parser {
                                                $t = substr( $t, 1 );
                                        } else {
                                                # paragraph
-                                               if ( trim( $t ) == '' ) {
+                                               if ( trim( $t ) === '' ) {
                                                        if ( $paragraphStack ) {
                                                                $output .= $paragraphStack.'<br />';
                                                                $paragraphStack = false;
index 66b8032..f0742f7 100644 (file)
Binary files a/maintenance/ExtraParserTests.txt and b/maintenance/ExtraParserTests.txt differ