From 80ca99fe5b9f7bb10ffae5789527b7a5d3c4f65e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 4 Oct 2017 16:37:14 -0700 Subject: wiki double encoding html entities --- Zotlabs/Render/Comanche.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index beee9796e..d126cb3da 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -168,6 +168,8 @@ class Comanche { return $y['xchan_addr']; elseif($x[1] == 'name') return $y['xchan_name']; + elseif($x[1] == 'webname') + return substr($y['xchan_addr'],0,strpos($y['xchan_addr'],'@')); return false; } return get_observer_hash(); -- cgit v1.2.3 From 4011dd18f01d275620b13815573e359c77664e3a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 8 Oct 2017 16:48:24 -0700 Subject: alternate navbar layouts --- Zotlabs/Render/Comanche.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index d126cb3da..ca664cba6 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -121,6 +121,11 @@ class Comanche { if($cnt) \App::$layout['theme'] = trim($matches[1]); + $cnt = preg_match("/\[navbar\](.*?)\[\/navbar\]/ism", $s, $matches); + if($cnt) + \App::$layout['navbar'] = trim($matches[1]); + + $cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER); if($cnt) { // only the last webpage definition is used if there is more than one -- cgit v1.2.3 From 623dfa13845e34c85eae2a66c6aa855c3e059c38 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 9 Oct 2017 15:13:25 -0700 Subject: purify user-supplied filenames in some cases. Probably not needed but it's the right thing to do. --- Zotlabs/Render/Comanche.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index ca664cba6..675282962 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -457,6 +457,9 @@ class Comanche { } } + if(! purify_filename($name)) + return '' + $clsname = ucfirst($name); $nsname = "\\Zotlabs\\Widget\\" . $clsname; -- cgit v1.2.3 From 89aa9a80c478bf83713138ee3a04130e8aa48fde Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 9 Oct 2017 15:51:30 -0700 Subject: typo --- Zotlabs/Render/Comanche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 675282962..c787b19ae 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -458,7 +458,7 @@ class Comanche { } if(! purify_filename($name)) - return '' + return ''; $clsname = ucfirst($name); $nsname = "\\Zotlabs\\Widget\\" . $clsname; -- cgit v1.2.3 From a652e546cccf270f8e837a549fb31b9d619239b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 11 Oct 2017 15:19:06 -0700 Subject: add local_channel as a comanche condition variable --- Zotlabs/Render/Comanche.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index c787b19ae..8831bd117 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -153,6 +153,7 @@ class Comanche { * $observer.address - xchan_addr or false * $observer.name - xchan_name or false * $observer - xchan_hash of observer or empty string + * $local_channel - logged in channel_id or false */ function get_condition_var($v) { @@ -162,6 +163,9 @@ class Comanche { return get_config($x[1],$x[2]); elseif($x[0] === 'request') return $_SERVER['REQUEST_URI']; + elseif($x[0] === 'local_channel') { + return local_channel(); + } elseif($x[0] === 'observer') { if(count($x) > 1) { if($x[1] == 'language') -- cgit v1.2.3