From 727b37b8ef7888b4f3ef4f2fb4011a374a4cac79 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Fri, 11 May 2007 19:17:58 +0000 Subject: [PATCH] Can disable Javascript git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@252 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/banana.inc.php.in | 1 + banana/page.inc.php | 3 +++ banana/text.func.inc.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index f09dc2b..0228ac2 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -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") diff --git a/banana/page.inc.php b/banana/page.inc.php index bec3f72..883865c 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -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; diff --git a/banana/text.func.inc.php b/banana/text.func.inc.php index 16b79ab..822fd1f 100644 --- a/banana/text.func.inc.php +++ b/banana/text.func.inc.php @@ -28,7 +28,7 @@ if (!function_exists('is_utf8')) { function banana_entities($source) { - if (is_string($source) || is_numeric($source)) { + if (is_string($source)) { return banana_htmlentities($source); } else { return $source; -- 2.1.4