Page MenuHomePhabricator

Fix passing null to non-null param of PHP internal functions in MediaWiki core (PHP 8.1 warning)
Open, Needs TriagePublicBUG REPORT

Description

It's deprecated in PHP 8.1, so in a lot of places, one could see notices like urlencode(): Passing null to parameter #1 ($string) of type string is deprecated.

Current unique issues from composer phpunit:unit only:

MediaWiki\Tests\Rest\Handler\UserContributionsHandlerTest::testThatParametersAreHandledCorrectlyForMeEndpoint with data set #0 (array())
urlencode(): Passing null to parameter #1 ($string) of type string is deprecated

tests/phpunit/unit/includes/Rest/Handler/HandlerTestTrait.php:62
includes/Rest/Handler.php:103
includes/Rest/Handler/UserContributionsHandler.php:92
includes/Rest/Handler/UserContributionsHandler.php:31
tests/phpunit/unit/includes/Rest/Handler/HandlerTestTrait.php:151
tests/phpunit/unit/includes/Rest/Handler/UserContributionsHandlerTest.php:175
tests/phpunit/MediaWikiUnitTestCase.php:108
SiteConfigurationTest::testSiteFromDb
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

includes/SiteConfiguration.php:515
tests/phpunit/unit/includes/SiteConfigurationTest.php:136
tests/phpunit/MediaWikiUnitTestCase.php:108
FileBackendGroupTest::testGuessMimeInternal with data set "No extension" ('foo', null, null, null, null)
strlen(): Passing null to parameter #1 ($string) of type string is deprecated

tests/phpunit/unit/includes/filebackend/FileBackendGroupTestTrait.php:413
tests/phpunit/MediaWikiUnitTestCase.php:108
  • This test shouldn't be marked as unity at all, it depends on wfExpandUrl() and therefore $wgServer.
HttpRequestFactoryTest::testCreate
substr(): Passing null to parameter #1 ($string) of type string is deprecated

includes/GlobalFunctions.php:782
includes/GlobalFunctions.php:490
includes/http/MWHttpRequest.php:101
includes/http/GuzzleHttpRequest.php:62
includes/http/HttpRequestFactory.php:120
tests/phpunit/unit/includes/http/HttpRequestFactoryTest.php:91
tests/phpunit/MediaWikiUnitTestCase.php:108

Details

ProjectBranchLines +/-Subject
mediawiki/coremaster+35 -25
mediawiki/coremaster+7 -4
mediawiki/extensions/OAuthREL1_39+4 -4
mediawiki/coreREL1_38+1 -1
mediawiki/coreREL1_35+1 -1
mediawiki/coreREL1_39+1 -1
mediawiki/coremaster+1 -1
mediawiki/extensions/OAuthREL1_38+4 -4
mediawiki/coremaster+1 -1
mediawiki/coremaster+22 -21
mediawiki/extensions/OAuthREL1_37+4 -4
mediawiki/coreREL1_39+27 -18
mediawiki/coremaster+27 -18
mediawiki/coreREL1_37+2 -2
mediawiki/coreREL1_39+2 -2
mediawiki/coreREL1_38+2 -2
mediawiki/coremaster+2 -2
mediawiki/coremaster+1 -1
mediawiki/extensions/OAuthREL1_35+4 -4
mediawiki/extensions/OAuthmaster+4 -4
mediawiki/coreREL1_35+116 -89
mediawiki/coreREL1_37+97 -88
mediawiki/coreREL1_38+100 -91
mediawiki/extensions/CirrusSearchmaster+3 -2
mediawiki/coreREL1_35+10 -4
mediawiki/coreREL1_38+10 -4
mediawiki/coreREL1_37+10 -4
mediawiki/coremaster+4 -4
mediawiki/coremaster+2 -2
mediawiki/coremaster+1 -1
mediawiki/coremaster+10 -4
mediawiki/coreREL1_35+1 -1
mediawiki/coreREL1_37+1 -1
mediawiki/coreREL1_38+1 -1
mediawiki/coreREL1_35+2 -2
mediawiki/coreREL1_37+2 -2
mediawiki/coreREL1_38+2 -2
mediawiki/coreREL1_38+4 -4
mediawiki/coreREL1_37+4 -4
mediawiki/coreREL1_35+4 -4
mediawiki/coremaster+41 -21
mediawiki/extensions/CirrusSearchmaster+5 -5
mediawiki/coremaster+1 -1
mediawiki/coremaster+59 -30
mediawiki/coremaster+3 -3
mediawiki/coreREL1_38+1 -1
mediawiki/coreREL1_37+1 -1
mediawiki/coreREL1_35+1 -1
mediawiki/coremaster+100 -91
mediawiki/coremaster+1 -1
mediawiki/coremaster+8 -8
mediawiki/coreREL1_35+10 -8
mediawiki/coreREL1_36+10 -8
mediawiki/coreREL1_37+10 -8
mediawiki/coremaster+10 -8
Show related patches Customize query in gerrit

Related Objects

StatusSubtypeAssignedTask
OpenBUG REPORTNone
ResolvedAmmarpad
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedKrinkle
ResolvedReedy
ResolvedReedy
ResolvedBUG REPORTJdforrester-WMF
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedZabe
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
ResolvedReedy
OpenBUG REPORTNone
ResolvedBUG REPORTReedy
ResolvedReedy
ResolvedReedy

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 813668 merged by jenkins-bot:

[mediawiki/core@REL1_37] Handle null passed to wfShorthandToInteger() and Html::element()

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

Change 813667 merged by jenkins-bot:

[mediawiki/core@REL1_38] Handle null passed to wfShorthandToInteger() and Html::element()

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

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

[mediawiki/core@REL1_38] Ensure that strlen() does not get passed a (valid) null

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

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

[mediawiki/core@REL1_37] Ensure that strlen() does not get passed a (valid) null

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

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

[mediawiki/core@REL1_35] Ensure that strlen() does not get passed a (valid) null

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

Change 813673 merged by jenkins-bot:

[mediawiki/core@REL1_35] Ensure that strlen() does not get passed a (valid) null

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

Change 813672 merged by jenkins-bot:

[mediawiki/core@REL1_37] Ensure that strlen() does not get passed a (valid) null

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

Change 813671 merged by jenkins-bot:

[mediawiki/core@REL1_38] Ensure that strlen() does not get passed a (valid) null

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

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

[mediawiki/core@REL1_38] Ensure we don't pass null to mb_strlen.

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

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

[mediawiki/core@REL1_37] Ensure we don't pass null to mb_strlen.

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

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

[mediawiki/core@REL1_35] Ensure we don't pass null to mb_strlen.

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

Change 813958 merged by jenkins-bot:

[mediawiki/core@REL1_35] Ensure we don't pass null to mb_strlen.

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

Change 813957 merged by jenkins-bot:

[mediawiki/core@REL1_37] Ensure we don't pass null to mb_strlen.

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

Change 813956 merged by jenkins-bot:

[mediawiki/core@REL1_38] Ensure we don't pass null to mb_strlen.

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

Change 814307 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_38] site: Consistently return null from Site::getDomain()

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

Change 814308 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_37] site: Consistently return null from Site::getDomain()

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

Change 814309 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_35] site: Consistently return null from Site::getDomain()

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

Change 814308 merged by jenkins-bot:

[mediawiki/core@REL1_37] site: Consistently return null from Site::getDomain()

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

Change 814309 merged by jenkins-bot:

[mediawiki/core@REL1_35] site: Consistently return null from Site::getDomain()

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

Change 814307 merged by jenkins-bot:

[mediawiki/core@REL1_38] site: Consistently return null from Site::getDomain()

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

Change 812400 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Ensure that strtr does not get null.

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

Change 818200 had a related patch set uploaded (by Brian Wolff; author: Simetrical):

[mediawiki/core@REL1_38] Get rid of warnings on PHP 8.1

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

Change 818201 had a related patch set uploaded (by Brian Wolff; author: Simetrical):

[mediawiki/core@REL1_37] Get rid of warnings on PHP 8.1

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

Change 818202 had a related patch set uploaded (by Brian Wolff; author: Simetrical):

[mediawiki/core@REL1_35] Get rid of warnings on PHP 8.1

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

Change 818200 merged by jenkins-bot:

[mediawiki/core@REL1_38] Get rid of warnings on PHP 8.1

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

Change 818201 merged by jenkins-bot:

[mediawiki/core@REL1_37] Get rid of warnings on PHP 8.1

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

Change 818202 merged by jenkins-bot:

[mediawiki/core@REL1_35] Get rid of warnings on PHP 8.1

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

Change 834621 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/OAuth@master] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834621 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834536 had a related patch set uploaded (by Reedy; author: Samwilson):

[mediawiki/extensions/OAuth@REL1_39] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834537 had a related patch set uploaded (by Reedy; author: Samwilson):

[mediawiki/extensions/OAuth@REL1_38] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834538 had a related patch set uploaded (by Reedy; author: Samwilson):

[mediawiki/extensions/OAuth@REL1_37] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834539 had a related patch set uploaded (by Reedy; author: Samwilson):

[mediawiki/extensions/OAuth@REL1_35] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834539 merged by jenkins-bot:

[mediawiki/extensions/OAuth@REL1_35] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 834734 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Don't pass null to json_decode() (deprecated in PHP 8.1)

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

Change 834734 merged by jenkins-bot:

[mediawiki/core@master] Don't pass null to json_decode() (deprecated in PHP 8.1)

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

Change 842560 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Avoid passing null to HTMLFormField methods

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

Change 854492 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/core@master] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854492 merged by jenkins-bot:

[mediawiki/core@master] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854081 had a related patch set uploaded (by Zabe; author: Thiemo Kreuz (WMDE)):

[mediawiki/core@REL1_39] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854082 had a related patch set uploaded (by Zabe; author: Thiemo Kreuz (WMDE)):

[mediawiki/core@REL1_38] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854083 had a related patch set uploaded (by Zabe; author: Thiemo Kreuz (WMDE)):

[mediawiki/core@REL1_37] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854083 merged by jenkins-bot:

[mediawiki/core@REL1_37] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854081 merged by jenkins-bot:

[mediawiki/core@REL1_39] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 854082 merged by jenkins-bot:

[mediawiki/core@REL1_38] api: Fix minor PHP 8.1 incompatibility in ApiOptions

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

Change 858993 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/core@master] Fix incomplete ITextFormatter mocks

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

Change 858993 merged by jenkins-bot:

[mediawiki/core@master] Fix incomplete ITextFormatter mocks

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

Change 859072 had a related patch set uploaded (by Zabe; author: Thiemo Kreuz (WMDE)):

[mediawiki/core@REL1_39] Fix incomplete ITextFormatter mocks

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

Change 859072 merged by jenkins-bot:

[mediawiki/core@REL1_39] Fix incomplete ITextFormatter mocks

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

Change 834538 abandoned by Umherirrender:

[mediawiki/extensions/OAuth@REL1_37] Avoid passing null to PHP 8.1 functions that don't support it

Reason:

EOL branch, T324133

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

Change 810964 abandoned by MarkAHershberger:

[mediawiki/core@master] Title: Fix Title::makeTitle to allow null $fragment

Reason:

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

Change 842560 merged by jenkins-bot:

[mediawiki/core@master] Avoid passing null to HTMLFormField methods

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

Change 834537 merged by jenkins-bot:

[mediawiki/extensions/OAuth@REL1_38] Avoid passing null to PHP 8.1 functions that don't support it

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

Change 885062 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 885062 merged by jenkins-bot:

[mediawiki/core@master] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884937 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_39] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884938 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_38] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884939 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_35] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884939 merged by jenkins-bot:

[mediawiki/core@REL1_35] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884937 merged by jenkins-bot:

[mediawiki/core@REL1_39] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 884938 merged by jenkins-bot:

[mediawiki/core@REL1_38] SpecialRevisionDelete: Set default of '' for wpReason

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

Change 834536 merged by jenkins-bot:

[mediawiki/extensions/OAuth@REL1_39] Avoid passing null to PHP 8.1 functions that don't support it

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