mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-25 19:20:18 +00:00
Defensive code for the case when addon_hooks key does not exist
This commit is contained in:
parent
d48f0010dd
commit
7ef81f909f
1 changed files with 6 additions and 1 deletions
|
@ -27,7 +27,12 @@ function mathjax_uninstall() {
|
|||
Addon::unregisterHook('template_vars', 'addon/mathjax/mathjax.php', 'mathjax_template_vars');
|
||||
}
|
||||
|
||||
function mathjax_template_vars($a, &$arr) {
|
||||
function mathjax_template_vars($a, &$arr)
|
||||
{
|
||||
if (!array_key_exists('addon_hooks',$arr['vars']))
|
||||
{
|
||||
$arr['vars']['addon_hooks'] = array();
|
||||
}
|
||||
$arr['vars']['addon_hooks'][] = "mathjax";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue