Plugins: do not save metadata along plugin parameters
Also prevent the token to be saved. Fixes #1550
This commit is contained in:
parent
e2dff28b44
commit
4ff703e369
5 changed files with 50 additions and 30 deletions
application/plugin
|
@ -100,20 +100,17 @@ class PluginManager
|
|||
*/
|
||||
public function executeHooks($hook, &$data, $params = array())
|
||||
{
|
||||
if (!empty($params['target'])) {
|
||||
$data['_PAGE_'] = $params['target'];
|
||||
}
|
||||
$metadataParameters = [
|
||||
'target' => '_PAGE_',
|
||||
'loggedin' => '_LOGGEDIN_',
|
||||
'basePath' => '_BASE_PATH_',
|
||||
'bookmarkService' => '_BOOKMARK_SERVICE_',
|
||||
];
|
||||
|
||||
if (isset($params['loggedin'])) {
|
||||
$data['_LOGGEDIN_'] = $params['loggedin'];
|
||||
}
|
||||
|
||||
if (isset($params['basePath'])) {
|
||||
$data['_BASE_PATH_'] = $params['basePath'];
|
||||
}
|
||||
|
||||
if (isset($params['bookmarkService'])) {
|
||||
$data['_BOOKMARK_SERVICE_'] = $params['bookmarkService'];
|
||||
foreach ($metadataParameters as $parameter => $metaKey) {
|
||||
if (array_key_exists($parameter, $params)) {
|
||||
$data[$metaKey] = $params[$parameter];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->loadedPlugins as $plugin) {
|
||||
|
@ -128,6 +125,10 @@ class PluginManager
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($metadataParameters as $metaKey) {
|
||||
unset($data[$metaKey]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue