]> git.mxchange.org Git - friendica-addons.git/commitdiff
Defensive code for the case when addon_hooks key does not exist
authorPascal Deklerck <pascal.deklerck@gmail.com>
Wed, 13 Jun 2018 19:57:59 +0000 (21:57 +0200)
committerPascal Deklerck <pascal.deklerck@gmail.com>
Wed, 13 Jun 2018 19:57:59 +0000 (21:57 +0200)
mathjax/mathjax.php

index 6f4dd395aa21419fdaded752e782f6121719425d..91a6a066d803f9da0b02720b412d208d7967ccbd 100644 (file)
@@ -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";
 }