Can disable Javascript
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Fri, 11 May 2007 19:17:58 +0000 (19:17 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:42 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@252 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
banana/page.inc.php
banana/text.func.inc.php

index f09dc2b..0228ac2 100644 (file)
@@ -53,6 +53,7 @@ class Banana
     static public $msgshow_externalimages = false;
     static public $msgshow_hasextimages   = false;
     static public $msgshow_withthread = true;
+    static public $msgshow_javascript = true;
 
     /** Match an url
      * Should be included in a regexp delimited using /, !, , or @ (eg: "/$url_regexp/ui")
index bec3f72..883865c 100644 (file)
@@ -333,6 +333,9 @@ class BananaPage extends Smarty
      */
     public function makeJs($src)
     {
+        if (!Banana::$msgshow_javascript) {
+            return '';
+        }
         if (function_exists('hook_makeJs')
                 && $res = hook_makeJs($src)) {
             return $res;
index 16b79ab..822fd1f 100644 (file)
@@ -28,7 +28,7 @@ if (!function_exists('is_utf8')) {
 \r
 function banana_entities($source)\r
 {\r
-    if (is_string($source) || is_numeric($source)) {\r
+    if (is_string($source)) {\r
         return banana_htmlentities($source);\r
     } else {\r
         return $source;\r