Author: widdis
Description:
I encountered a problem exhibited in the latest version of the TableEdit extension on the latest svn version of MW 1.17. The root cause of the problem is that the constants defined in the memcached-client.php include file are not properly interpreted.
Problematic file is:
http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_17/phase3/includes/memcached-client.php?view=markup
Error message is:
Fatal error: Undefined class constant 'COMPRESSED' in /<path>/includes/memcached-client.php on line 973
(Similar error for COMPRESSION_SAVINGS. I didn't encounter the SERIALIZED error but might have if I had gone down a different branch of code.)
In the problematic lines, the constants are referred to using self::, i.e., self::COMPRESSED, self::COMPRESSION_SAVINGS, and self::SERIALIZED
self:: refers to the scope at the point of definition not at the point of execution. This is problematic in an include file.
For PHP 5.3+, the correct syntax is to use static:: to refer to the constants.
Version: 1.17.x
Severity: normal