r82673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82672‎ | r82673 | r82674 >
Date:15:54, 23 February 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Followup r82550: define variables passed by reference to preg_match() beforehand, to prevent E_NOTICEs
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -353,6 +353,8 @@
354354 // Guard against delimiter nulls in the input
355355 $text = str_replace( "\000", '', $text );
356356
 357+ $markupMatches = null;
 358+ $elementMatches = null;
357359 while ( $startPos < strlen( $text ) ) {
358360 if ( preg_match( $reg, $text, $markupMatches, PREG_OFFSET_CAPTURE, $startPos ) ) {
359361 $elementPos = $markupMatches[0][1];

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82550Rewrote LanguageConverter::autoConvert() to make it use preg_match() with an ...tstarling14:17, 21 February 2011

Comments

#Comment by Nikerabbit (talk | contribs)   15:57, 23 February 2011

Does that really cause E_NOTICE? I haven't ever seen any.

#Comment by Catrope (talk | contribs)   16:06, 23 February 2011

Huh, you're right, I just tried locally and I'm not getting an E_NOTICE. I swear passing in undefined variables by reference caused an E_NOTICE before; maybe it's been fixed in PHP 5.3 or something.

Status & tagging log