Page MenuHomePhabricator

Deprecate and remove $wgAutoloadAttemptLowercase
Open, MediumPublic

Description

It's still set as true by default: https://gerrit.wikimedia.org/g/mediawiki/core/+/fef19e24d7ffa1da54d999eb06e4e777f638dc71/includes/DefaultSettings.php#7409

It has been set false in development settings and WMF config for quite some time now. Maybe set it to false for next release, and remove after that?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 28 2019, 7:08 AM
Inline documentation
/**
 * Switch controlling legacy case-insensitive classloading.
 * Do not disable if your wiki must support data created by PHP4, or by
 * MediaWiki 1.4 or earlier.
 */
$wgAutoloadAttemptLowercase = true;

given T8777: Remove PHP 4 compat cruft was closed in 2006, is this safe to disable?

Reedy added a subscriber: Reedy.May 26 2020, 11:35 AM

Do not disable if your wiki must support data created by PHP4, or by MediaWiki 1.4 or earlier.

Is there anything likely stored in the database of ancient wikis where this might be a problem? Serialised PHP class names in the wrong case etc?

Sounds unlikely given T166759: If possible, turn off $wgAutoloadAttemptLowercase. Not sure if third party wikis would need any kind of migration.

A quick look at the task suggest at least some back compat aliases were added etc. So I think we're probably in a reasonable state. I guess if people report them, we can add others (if they exist/are needed)

The autoloader.log used in those tasks seems to not exist on mwlog1001 anymore. I don't know if there's any benefit from re-enabling it to check further

However, looking at the codebase, we've definitely got cases of case mismatching classes, and many more functions that have snuck in again...

Change 598738 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Fix a plethora of class and function call case mismatches

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

Change 598739 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Deprecate $wgAutoloadAttemptLowercase and set default to false

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

Krinkle triaged this task as Medium priority.May 26 2020, 3:25 PM
Reedy added a comment.May 26 2020, 3:29 PM

MW core fixed up in patch going through CI now. Extensions listed in T253628: Case mismatch of functions and classes. Skins still to dump on a task, though WMF production skins patches are up; one is blocked on a phan issue. PHPCS possible sniff in T253625: Check to find incorrectly cased php classes and function calls to prevent regressions (if possible)

Change 598738 merged by jenkins-bot:
[mediawiki/core@master] Fix a plethora of class and function call case mismatches

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

Change 598739 merged by jenkins-bot:
[mediawiki/core@master] Deprecate $wgAutoloadAttemptLowercase and set default to false

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