mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/add_events] Rename core.append_sid_override to just core.append_sid
Also, I added the hook back in below the event for backwards compatibility. PHPBB3-9550
This commit is contained in:
parent
e80e3809b9
commit
0ba755f1bd
1 changed files with 14 additions and 2 deletions
|
@ -2247,7 +2247,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||||
* To override this function, the event must set $append_sid_override to
|
* To override this function, the event must set $append_sid_override to
|
||||||
* the new URL value, which will be returned following the event
|
* the new URL value, which will be returned following the event
|
||||||
*
|
*
|
||||||
* @event core.append_sid_override
|
* @event core.append_sid
|
||||||
* @var string url The url the session id needs to be
|
* @var string url The url the session id needs to be
|
||||||
* appended to (can have params)
|
* appended to (can have params)
|
||||||
* @var mixed params String or array of additional url
|
* @var mixed params String or array of additional url
|
||||||
|
@ -2262,13 +2262,25 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||||
* @since 3.1-A1
|
* @since 3.1-A1
|
||||||
*/
|
*/
|
||||||
$vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_override');
|
$vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_override');
|
||||||
extract($phpbb_dispatcher->trigger_event('core.append_sid_override', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars)));
|
||||||
|
|
||||||
if ($append_sid_override)
|
if ($append_sid_override)
|
||||||
{
|
{
|
||||||
return $append_sid_override;
|
return $append_sid_override;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The following hook remains for backwards compatibility, though use of
|
||||||
|
// the event above is preferred.
|
||||||
|
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately.
|
||||||
|
// They could mimic most of what is within this function
|
||||||
|
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
|
||||||
|
{
|
||||||
|
if ($phpbb_hook->hook_return(__FUNCTION__))
|
||||||
|
{
|
||||||
|
return $phpbb_hook->hook_return_result(__FUNCTION__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$params_is_array = is_array($params);
|
$params_is_array = is_array($params);
|
||||||
|
|
||||||
// Get anchor
|
// Get anchor
|
||||||
|
|
Loading…
Add table
Reference in a new issue