Author: achuggard
Description:
In Parser.php (HEAD r30284) function getVariableValue there are 2 hooks ParserGetVariableValueSwitch and ParserGetVariableValueVarCache whose return values can affect the return value of the function. Code is as follows:
if ( wfRunHooks( 'ParserGetVariableValueVarCache', array( &$this, &$this->mVarCache ) ) ) {
if ( isset( $this->mVarCache[$index] ) ) { return $this->mVarCache[$index]; }
}
...
if ( wfRunHooks( 'ParserGetVariableValueSwitch', array( &$this, &$this->mVarCache, &$index, &$ret ) ) )
return $ret;
else
return null;
I believe that in both of these cases that the check should take the form of if (!wfRunHooks (blah) ) because currently if an extension function returns false (to indicate no matching variable value per http://www.mediawiki.org/wiki/Manual:Variables#Example) this would prevent other variable extensions hooking these points from running. If the extension function returns true (to indicating the variable was handled by an extensions) later running extensions could handle the same variable and clobber the results of previous extensions.
Version: 1.12.x
Severity: normal