From 17119f0d510a11969829b6bc9e58089652f9b017 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Dec 2011 23:07:18 +0100 Subject: [PATCH] Fix: Miscellaneous fix --- htdocs/lib/functions.lib.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 335c885ce40..ac3c9b67fdd 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -47,7 +47,7 @@ if (! function_exists('json_encode')) function json_encode($elements) { $num = count($elements); - + // determine type if (is_numeric(key($elements))) { @@ -77,11 +77,11 @@ if (! function_exists('json_encode')) } $output.= '}'; } - + // return return $output; } - + function _val($val) { if (is_string($val)) return '"'.rawurlencode($val).'"'; @@ -104,7 +104,7 @@ if (! function_exists('json_decode')) function json_decode($json, $assoc=false) { $comment = false; - + for ($i=0; $i $value) { $object->{$key} = $value; } - + return $object; } - + return false; } - + return $array; } } @@ -3937,7 +3937,8 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb unset($_SESSION['mesgarray']); } - if (! empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! preg_match('/
/i',$out)) + // If inline message with no format, we add it. + if ((empty($conf->use_javascript_ajax) || ! empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && ! preg_match('/
/i',$out)) { $divstart='
'; $divend='
'; @@ -3967,7 +3968,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb if ($out) { - if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded)) + if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded)) { $return = '