Hi everybody!
I don't think that using initvar() is a good idea. Often using a local variable or a property of an object is sufficient instead of introding a new global variable, and often it is best to clearly distinguish between "GET" and "POST" parameters. In any way, global variables should be best avoided, but if they are used, they should be at least clearly marked as such, instead of defining them via a function (which gets more easily overlooked and is harder to grep for).
Therefore, I suggest to deprecate initvar() in CMSimple_XH 1.7. The function is used by the core only in two places, where we could inline the function (possibly using a closure instead) to avoid the deprecation notice. It's not really great to tell plugin developers not to use a function, but to use it in the core behind the scenes, but I guess we can't go further for XH 1.7 for BC reasons.
Deprecate initvar() in XH 1.7.0
Deprecate initvar() in XH 1.7.0
Christoph M. Becker – Plugins for CMSimple_XH
Re: Deprecate initvar() in XH 1.7.0
To clarify with regard to plugins which sometimes call `initvar('admin')` and `initvar('action')`: the latter is never needed, as $action is already initialized by the core since a very long time (actually much longer than CMSimple_XH 1.5.10). The former may still be necessary, although `initvar('admin')` is called inside `print_plugin_admin()` which is often called before `$admin` is used. However, some plugins may not call `print_plugin_main()`, so it appears to make sense to add 'admin' to the list of global variables which are initialized early by the core – I don't see any relevant BC issues with this.
Christoph M. Becker – Plugins for CMSimple_XH