one thing that bothers me since quite some time, is the setting of arbitrary GET parameters without value to 'true'. cmsimple/cms.php line 193ff:
Code: Select all
for ($i = 0; $i < $v; $i++)
if (!strpos($rq[$i], '='))
$GLOBALS[$rq[$i]] = 'true';
So shouldn't these lines be removed? Let's ask the oracle
The problem: this would break compatibility with all existing plugins, as those are called by their name as GET parameter. IMO it would be way better to call them by a special GET parameter with their name as value, e.g. instead of http://www.example.com/?pagemanager to call them by http://www.example.com/?xhplugin=pagemanager.
Perhaps you consider the following intermediate solution: plugins using this new style could be marked as such (e.g. by having a file newstyle.htm in the plugin's folder). So the core and PL can check for the existance of this file, and if found, could emit the new style links in the plugin menu. To maintain backward compatibility with older versions of CMSimple(_XH), the plugin should emit those links with respect to CMSIMPLE_VERSION or PLUGINLOADER_VERSION. This could be simplified by using a function along the following lines (a constant might be used as well):
Code: Select all
function my_plugin_link() {
return (version_compare(PLUGINLOADER_VERSION, '2.2', '>=') ? 'xhplugin=' : '') ? 'my_plugin';
}
An additional benefit: the name of the plugin could be used as global array to store the plugin's global data.
What do you think? Did I oversee some other use of the "pseudo register_globals" code? Can this solution be improved?
Christoph