https://reisub.nsupdate.info/git
/
friendica-addons.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d48f001
)
Defensive code for the case when addon_hooks key does not exist
author
Pascal Deklerck
<pascal.deklerck@gmail.com>
Wed, 13 Jun 2018 19:57:59 +0000
(21:57 +0200)
committer
Pascal Deklerck
<pascal.deklerck@gmail.com>
Wed, 13 Jun 2018 19:57:59 +0000
(21:57 +0200)
mathjax/mathjax.php
patch
|
blob
|
history
diff --git
a/mathjax/mathjax.php
b/mathjax/mathjax.php
index
6f4dd39
..
91a6a06
100644
(file)
--- a/
mathjax/mathjax.php
+++ b/
mathjax/mathjax.php
@@
-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";
}