Page MenuHomePhabricator

PHP Warning: substr() expects parameter 1 to be string, object given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: substr() expects parameter 1 to be string, object given
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.3/includes/GlobalFunctions.php(432)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.38.0-wmf.3/includes/GlobalFunctions.php(432): substr(MediaWiki\Extensions\SecurePoll\Pages\VotePage, integer, NULL)
#2 /srv/mediawiki/wmf-config/CommonSettings.php(1430): wfAppendQuery(MediaWiki\Extensions\SecurePoll\Pages\VotePage, string)
#3 /srv/mediawiki/php-1.38.0-wmf.3/includes/HookContainer/HookContainer.php(338): {closure}(MediaWiki\Extensions\SecurePoll\Pages\VotePage, MediaWiki\Extensions\SecurePoll\Pages\VotePage)
#4 /srv/mediawiki/php-1.38.0-wmf.3/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#5 /srv/mediawiki/php-1.38.0-wmf.3/extensions/SecurePoll/includes/Hooks/HookRunner.php(60): MediaWiki\HookContainer\HookContainer->run(string, array)
#6 /srv/mediawiki/php-1.38.0-wmf.3/extensions/SecurePoll/includes/Pages/VotePage.php(336): MediaWiki\Extensions\SecurePoll\Hooks\HookRunner->onSecurePoll_JumpUrl(MediaWiki\Extensions\SecurePoll\Pages\VotePage, string)
#7 /srv/mediawiki/php-1.38.0-wmf.3/extensions/SecurePoll/includes/Pages/VotePage.php(133): MediaWiki\Extensions\SecurePoll\Pages\VotePage->showJumpForm()
#8 /srv/mediawiki/php-1.38.0-wmf.3/extensions/SecurePoll/includes/SpecialSecurePoll.php(70): MediaWiki\Extensions\SecurePoll\Pages\VotePage->execute(array)
#9 /srv/mediawiki/php-1.38.0-wmf.3/includes/specialpage/SpecialPage.php(647): MediaWiki\Extensions\SecurePoll\SpecialSecurePoll->execute(string)
#10 /srv/mediawiki/php-1.38.0-wmf.3/includes/specialpage/SpecialPageFactory.php(1375): SpecialPage->run(string)
#11 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#12 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(925): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(559): MediaWiki->main()
#14 /srv/mediawiki/php-1.38.0-wmf.3/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-1.38.0-wmf.3/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
Notes

There are also similar substr() and strpos() errors in nearby lines of code.

There errors first started happening Oct 10, 2021 @ 00:00:10.034

Event Timeline

Change 730215 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/SecurePoll@master] Fix wrong var being passed

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

Change 730230 had a related patch set uploaded (by Majavah; author: Zabe):

[mediawiki/extensions/SecurePoll@wmf/1.38.0-wmf.3] Fix wrong var being passed

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

Change 730231 had a related patch set uploaded (by Majavah; author: Zabe):

[mediawiki/extensions/SecurePoll@wmf/1.38.0-wmf.4] Fix wrong var being passed

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

Change 730215 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Fix wrong var being passed

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

Change 730230 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@wmf/1.38.0-wmf.3] Fix wrong var being passed

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

Mentioned in SAL (#wikimedia-operations) [2021-10-12T15:58:15Z] <dancy@deploy1002> Synchronized php-1.38.0-wmf.3/extensions/SecurePoll/includes/Hooks/HookRunner.php: Backport: [[gerrit:730230|Fix wrong var being passed (T289950 T293102)]] (duration: 02m 13s)

Change 730231 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@wmf/1.38.0-wmf.4] Fix wrong var being passed

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

Mentioned in SAL (#wikimedia-operations) [2021-10-12T16:06:08Z] <dancy@deploy1002> Synchronized php-1.38.0-wmf.4/extensions/SecurePoll/includes/Hooks/HookRunner.php: Backport: [[gerrit:730231|Fix wrong var being passed (T289950 T293102)]] (duration: 00m 57s)

dancy added a subscriber: Majavah.

Thanks @Majavah for fixes!

Thanks @Majavah for fixes!

@Zabe made them, I just approved them and sent them to you for backports.