From: Platonides Date: Fri, 28 May 2010 14:16:46 +0000 (+0000) Subject: (bug 8689) Use strict php comparison, so that inserting a long numeric line doesn... X-Git-Tag: 1.31.0-rc.0~36687 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=3b150034a08872e858684c604d37ca92b58b920a;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1bec8965aa..872486d3c1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/includes/Linker.php b/includes/Linker.php index 8b268b5e80..79e417ebe2 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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]; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e14d54b5e1..cd32813e5a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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.'
'; $paragraphStack = false; diff --git a/maintenance/ExtraParserTests.txt b/maintenance/ExtraParserTests.txt index 66b8032d18..f0742f706d 100644 Binary files a/maintenance/ExtraParserTests.txt and b/maintenance/ExtraParserTests.txt differ