function setAjaxReplyContent ($content) {
// Log message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'content()=' . strlen($content));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'content[]=' . gettype($content));
// Set it, but with URL encoding
$GLOBALS['ajax_reply']['reply_content'] = urlencode(doFinalCompilation($content, FALSE));
// Trim value and session variable
$var = trim(secureString($var));
- $value = trim($value);
+
+ // Is the value no array?
+ if (!is_array($value)) {
+ // Then trim it
+ $value = trim($value);
+ } // END - if
// Is the session variable set?
- if (('' . $value . '' == '') && (isSessionVariableSet($var))) {
+ if ((!is_array($value)) && ('' . $value . '' == '') && (isSessionVariableSet($var))) {
// Remove the session
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UNSET:' . $var . '=' . getSession($var));
unset($_SESSION[$var]);
// PHP version < 5.3.0
return session_unregister($var);
}
- } elseif (('' . $value . '' != '') && (!isSessionVariableSet($var))) {
+ } elseif ((is_array($value)) || (('' . $value . '' != '') && (!isSessionVariableSet($var)))) {
// Set session
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value);
$_SESSION[$var] = $value;
// Main compilation loop
function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) {
+ // Code must not be an array (happens in installer)
+ assert(!is_array($code));
+
// Insert comments? (Only valid with HTML templates, of course)
enableTemplateHtml($insertComments);
// Compile it
//* DEBUG: */ debugOutput('<pre>'.lineNumberCode($code).'</pre>');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'code[]=' . gettype($code) . ',enableCodes[]=' . gettype($enableCodes));
$eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), $enableCodes)) . '";';
//* DEBUG: */ if (!$insertComments) print('EVAL=<pre>'.lineNumberCode($eval).'</pre>');
eval($eval);
// "Compiles" the given value and sets it in given key
function setSessionCompiled ($key, $value) {
- // "Compile" the value
- $value = doFinalCompilation(compileRawCode($value));
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key[]=' . gettype($key) . ',value[]=' . gettype($value));
+
+ // Is the value not an array?
+ if (!is_array($value)) {
+ // "Compile" the value
+ $value = doFinalCompilation(compileRawCode($value));
+ } // END - if
// And set it
return setSession($key, $value);