Page MenuHomePhabricator

The #pos parser function will throw E_WARNING if the offset is longer than the string.
Closed, ResolvedPublic

Description

The mb_strpos() function throws E_WARNING if the offset is longer than the length of the string. This change takes the shorter of the two integers.

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/ParserFunctions/+/473768/

Event Timeline

Change 473768 had a related patch set uploaded (by Legoktm; owner: Alexia):
[mediawiki/extensions/ParserFunctions@master] The mb_strpos() function throws E_WARNING if the offset is longer than the length of the string.

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

Legoktm added a subscriber: Legoktm.

Should be trivial to backport...

Change 473768 merged by jenkins-bot:
[mediawiki/extensions/ParserFunctions@master] Fix E_WARNING with {{#pos:}} if the offset is larger than the string

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

Change 480898 had a related patch set uploaded (by Legoktm; owner: Alexia):
[mediawiki/extensions/ParserFunctions@REL1_32] Fix E_WARNING with {{#pos:}} if the offset is larger than the string

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

Change 480899 had a related patch set uploaded (by Legoktm; owner: Alexia):
[mediawiki/extensions/ParserFunctions@REL1_31] Fix E_WARNING with {{#pos:}} if the offset is larger than the string

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

Change 480898 merged by jenkins-bot:
[mediawiki/extensions/ParserFunctions@REL1_32] Fix E_WARNING with {{#pos:}} if the offset is larger than the string

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

Change 480899 merged by jenkins-bot:
[mediawiki/extensions/ParserFunctions@REL1_31] Fix E_WARNING with {{#pos:}} if the offset is larger than the string

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