Hi everybody,
May be I make a mistake, but I think there is code without effect in functions variable_set and variable_del.

The start of the function create a copy of the global variable $conf, using the keyword global. After that, the local copy is mofified using $conf[$name] = $value for variable_set, and unset($conf[$name]) for variable_del.

And this is the copy which is modified, not the global instance $GLOBALS['conf'], perhaps what is wanted in the function.

We may need to replace the lines, like that
In variable_set : Replacing $conf[$name] = $value by $GLOBALS['conf'][$name] = $value
And in variable_del : Replacing unset($conf[$name]) by unset($GLOBALS['conf'][$name]).

Is it right ?

Comments

Owen Barton’s picture

Actually the global keyword creates a local context for the global variable, not a copy - you can then edit it directly without needing to use the GLOBALS array.