Page MenuHomePhabricator

Inconsistent handling of message cache key normalisation
Closed, InvalidPublic

Description

Author: osrc-sysint

Description:
normalises keys that are added to MessageCache

The following bug was found and examined in mediawiki 1.10.0 but a short look at the source code of 1.11 lets me assume its still in there too. Version 1.8 is not affected.

The method get() of the class MessageObject in include/MessageCache.php enforces message normalisation by lowercasing the first char of a key and replacing all underscores with blanks in these keys. Since this normalisation is not applied when messages are stored in the cache (e.g. by method addMessages), this breaks extensions which do not us normalised keys (like PageProtectionPlus). The attached patch applies normalisation on message adding.


Version: unspecified
Severity: normal

Attached:

Details

Reference
bz11852

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:58 PM
bzimport set Reference to bz11852.
bzimport added a subscriber: Unknown Object (MLST).

Not really worth the overhead. The extensions that misuse this should be fixed.

ayg wrote:

(In reply to comment #1)

Not really worth the overhead. The extensions that misuse this should be fixed.

What overhead? It's like a five-line fix and reportedly a regression.

addMessages() doesn't exist anymore. Nothing really to fix here, marking INVALID.