Page MenuHomePhabricator

PHP 8.1: WebRequest::getFuzzyBool may emit deprecation warnings
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Given code of the form

$someParam = $request->getFuzzyBool( 'someparam', true );

where $request is a WebRequest, a deprecation warning will be emitted on PHP 8.1 or newer:

PHP Deprecated: strcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /includes/WebRequest.php on line 677
	#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer)
	#1 /includes/WebRequest.php(677): strcasecmp(NULL, string)
        [...code that called getFuzzyBool]

Event Timeline

Change 973783 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/core@master] WebRequest: Fix PHP 8.1 deprecations in getFuzzyBool()

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

Change 973783 merged by jenkins-bot:

[mediawiki/core@master] WebRequest: Fix PHP 8.1 deprecations in getFuzzyBool()

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

matmarex reassigned this task from matmarex to TK-999.