Page MenuHomePhabricator

Warning: mb_strpos() expects parameter 3 to be long, string given in /srv/web/extensions-mainwiki-git/ParserFunctions/ParserFunctions_body.php on line 603
Closed, ResolvedPublic

Description

Warning: mb_strpos() expects parameter 3 to be long, string given in /srv/web/extensions-mainwiki-git/ParserFunctions/ParserFunctions_body.php on line 603

Tis message occurs in
https://wiki.piratenpartei.de/Benutzer:Stimmbürger
both in page view and previews but strangely not when you select a page version.
The most recent version of the page is of 02:33, 14. Jan 2014‎

Installed ParserFunctions Ver. 1.6.0 (a07a84f) of 21:49, 1. Apr 2014


Version: REL1_22-branch
Severity: normal
URL: https://wiki.piratenpartei.de/Benutzer:Stimmbürger

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:43 AM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz70325.
bzimport added a subscriber: Unknown Object (MLST).

webmaster wrote:

An easy way to reproduce this issue was found by Allan Wegan, simply add the following to a wiki page:
{{#pos:haystack|needle|}}

Removing the last | symbol makes the warning go away.

This issue could be fixed by replacing the line in ParserFunctions_body.php with:
$pos = mb_strpos( $inStr, $inNeedle, intval( $inOffset ) );

In current version 1.6.0 it's in line 603. I could also reproduce this issue with current master (0b96cba), here the problem is in line 627.

Change 177599 had a related patch set uploaded (by Umherirrender):
mb_strpos() expects parameter 3 to be long, string given

https://gerrit.wikimedia.org/r/177599

Patch-For-Review

Change 177599 merged by jenkins-bot:
mb_strpos() expects parameter 3 to be long, string given

https://gerrit.wikimedia.org/r/177599

Umherirrender claimed this task.