r51483 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51482‎ | r51483 | r51484 >
Date:00:06, 5 June 2009
Author:rarohde
Status:ok
Tags:
Comment:
(Bug 19078) Restore #pos default behavior unintentionally changed in r50997
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions.php
@@ -620,7 +620,7 @@
621621 * Finds first occurrence of "needle" in "string" starting at "offset".
622622 *
623623 * Note: If the needle is an empty string, single space is used instead.
624 - * Note: If the needle is not found, -1 is returned.
 624+ * Note: If the needle is not found, empty string is returned.
625625 */
626626 function runPos ( &$parser, $inStr = '', $inNeedle = '', $inOffset = 0 ) {
627627 wfProfileIn( __METHOD__ );
@@ -637,7 +637,7 @@
638638 if( $inNeedle == '' ) { $inNeedle = ' '; }
639639
640640 $pos = mb_strpos( $inStr, $inNeedle, $inOffset );
641 - if( $pos === false ) { $pos = -1; }
 641+ if( $pos === false ) { $pos = ""; }
642642
643643 wfProfileOut( __METHOD__ );
644644 return $pos;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50997(Bug 6455) Add string function support to ParserFunctionsrarohde00:43, 26 May 2009

Status & tagging log