From 685686b3e81e53264b4946f54904e8f5323da2ea Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Sat, 3 Mar 2012 00:00:38 +0100 Subject: template proc: fix variables regexp --- include/template_processor.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/template_processor.php b/include/template_processor.php index 111fc5849..8671587fc 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -160,7 +160,16 @@ private function var_replace($s){ $m = array(); - if (preg_match_all('/\$\[{0,1}([a-zA-Z0-9-_]+\.*)+\]{0,1}/', $s,$m)){ + /** regexp: + * \$ literal $ + * (\[)? optional open square bracket + * ([a-zA-Z0-9-_]+\.?)+ var name, followed by optional + * dot, repeated at least 1 time + * (?(1)\]) if there was opened square bracket + * (subgrup 1), match close bracket + */ + if (preg_match_all('/\$(\[)?([a-zA-Z0-9-_]+\.?)+(?(1)\])/', $s,$m)){ + foreach($m[0] as $var){ $varn = str_replace(array("[","]"), array("",""), $var); $val = $this->_get_var($varn, true); -- cgit v1.2.3 From 333942898782f3e197a660eb841ccbd296a83475 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Sat, 3 Mar 2012 00:12:45 +0100 Subject: fix @mention autocomplete in comments --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index a5d1214cb..c20455ad1 100755 --- a/js/main.js +++ b/js/main.js @@ -292,7 +292,7 @@ $('body').css('cursor', 'auto'); } /* autocomplete @nicknames */ - $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl"); + $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl"); }); } -- cgit v1.2.3