http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67014

Revision: 67014
Author:   platonides
Date:     2010-05-28 14:16:46 +0000 (Fri, 28 May 2010)

Log Message:
-----------
(bug 8689) Use strict php comparison, so that inserting a long numeric line 
doesn't produce a fatal error when php tries to convert it to a number.

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/Linker.php
    trunk/phase3/includes/parser/Parser.php
    trunk/phase3/maintenance/ExtraParserTests.txt

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-05-28 13:35:29 UTC (rev 67013)
+++ trunk/phase3/RELEASE-NOTES  2010-05-28 14:16:46 UTC (rev 67014)
@@ -180,6 +180,7 @@
 * (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.

Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php    2010-05-28 13:35:29 UTC (rev 67013)
+++ trunk/phase3/includes/Linker.php    2010-05-28 14:16:46 UTC (rev 67014)
@@ -1449,7 +1449,7 @@
                        $regex = $wgContLang->linkTrail();
                }
                $inside = '';
-               if ( $trail != '' ) {
+               if ( $trail !== '' ) {
                        $m = array();
                        if ( preg_match( $regex, $trail, $m ) ) {
                                $inside = $m[1];

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2010-05-28 13:35:29 UTC (rev 
67013)
+++ trunk/phase3/includes/parser/Parser.php     2010-05-28 14:16:46 UTC (rev 
67014)
@@ -721,8 +721,9 @@
         */
        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 @@
                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 @@
                                                $t = substr( $t, 1 );
                                        } else {
                                                # paragraph
-                                               if ( trim( $t ) == '' ) {
+                                               if ( trim( $t ) === '' ) {
                                                        if ( $paragraphStack ) {
                                                                $output .= 
$paragraphStack.'<br />';
                                                                $paragraphStack 
= false;

Modified: trunk/phase3/maintenance/ExtraParserTests.txt
===================================================================
(Binary files differ)



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to