r5365 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5364‎ | r5365 | r5366 >
Date:19:03, 21 September 2004
Author:kateturner
Status:old
Tags:
Comment:
don't error on certain inputs if $matches[] doesn't have a last element
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -1858,10 +1858,9 @@
18591859 $nsec = 0;
18601860 for( $i = 0; $i < count($matches); $i += 2 ) {
18611861 wfDebug("text=[".$matches[$i]."] heading=[".$matches[$i+1]."]\n");
1862 - if ($matches[$i] == "" && $matches[$i + 1] == "") break;
18631862 $text .= $matches[$i];
 1863+ if (!isset($matches[$i + 1]) || $matches[$i + 1] == "") continue;
18641864 $hl = $matches[$i + 1];
1865 - if ($hl == "") continue;
18661865 if( strstr($hl, "<!--MWTEMPLATESECTION") ) {
18671866 $text .= $hl;
18681867 continue;

Status & tagging log