';
@@ -541,14 +548,14 @@ function getMenuCssClasses ($data) {
}
// Generate XHTML code for the CAPTCHA
-function generateCaptchaCode ($code, $type, $DATA, $userid) {
- return '';
+function generateCaptchaCode ($code, $type, $type, $userid) {
+ return '';
}
// Compiles the given HTML/mail code
-function compileCode ($code, $simple = false, $constants = true, $full = true) {
- // Is the code a string?
- if (!is_string($code)) {
+function compileCode ($code, $simple = false, $constants = true, $full = true, $compileCode = true) {
+ // Is the code a string or should we not compile?
+ if ((!is_string($code)) || ($compileCode === false)) {
// Silently return it
return $code;
} // END - if
@@ -574,9 +581,9 @@ function compileCode ($code, $simple = false, $constants = true, $full = true) {
// Compiles the code (use compileCode() only for HTML because of the comments)
// @TODO $simple/$constants are deprecated
-function compileRawCode ($code, $simple = false, $constants = true, $full = true) {
- // Is the code a string?
- if (!is_string($code)) {
+function compileRawCode ($code, $simple = false, $constants = true, $full = true, $compileCode = true) {
+ // Is the code a string or shall we not compile?
+ if ((!is_string($code)) || ($compileCode === false)) {
// Silently return it
return $code;
} // END - if
@@ -585,7 +592,9 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
$secChars = $GLOBALS['url_chars'];
// Select full set of chars to replace when we e.g. want to compile URLs
- if ($full === true) $secChars = $GLOBALS['security_chars'];
+ if ($full === true) {
+ $secChars = $GLOBALS['security_chars'];
+ } // END - if
// Compile more through a filter
$code = runFilterChain('compile_code', $code);
@@ -594,10 +603,7 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
$code = str_replace('{--', '{%message,', str_replace('--}', '%}', $code));
// Compile QUOT and other non-HTML codes
- foreach ($secChars['to'] as $k => $to) {
- // Do the reversed thing as in inc/libs/security_functions.php
- $code = str_replace($to, $secChars['from'][$k], $code);
- } // END - foreach
+ $code = str_replace($secChars['to'], $secChars['from'], $code);
// Find $content[bla][blub] entries
// @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
@@ -619,7 +625,7 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
// Does this entry exist?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "found={$found},match={$match},set={$set} ");
if ($test == $match) {
- // Match found!
+ // Match found
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "fuzzyFound! ");
$fuzzyFound = true;
break;
@@ -817,6 +823,7 @@ function generateImageOrCode ($img_code, $headerSent = true) {
// Remove image from memory
imagedestroy($image);
}
+
// Create selection box or array of splitted timestamp
function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
// Do not continue if ONE_DAY is absend
@@ -840,7 +847,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
$M2 = getMonth(time() + $timestamp);
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) $SWITCH = getOneDay();
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) {
+ $SWITCH = getOneDay();
+ } // END - switch
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
@@ -1023,7 +1032,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
// Generate a list of administrative links to a given userid
function generateMemberAdminActionLinks ($userid) {
// Make sure userid is a number
- if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ if ($userid != bigintval($userid)) {
+ debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ } // END - if
// Define all main targets
$targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
@@ -1228,7 +1239,9 @@ function handleCodeMessage () {
$ext = 'unknown';
// Is extension given?
- if (isGetRequestParameterSet('ext')) $ext = getRequestParameter('ext');
+ if (isGetRequestParameterSet('ext')) {
+ $ext = getRequestParameter('ext');
+ } // END - if
// Convert the 'code' parameter from URL to a human-readable message
$message = getMessageFromErrorCode(getRequestParameter('code'));
@@ -1238,6 +1251,27 @@ function handleCodeMessage () {
} // END - if
}
+// Generates a 'extension foo out-dated' message
+function generateExtensionOutdatedMessage ($ext_name, $ext_ver) {
+ // Is the extension empty?
+ if (empty($ext_name)) {
+ // This should not happen
+ debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
+ } // END - if
+
+ // Default message
+ $message = getMaskedMessage('EXTENSION_PROBLEM_EXTENSION_OUTDATED', $ext_name);
+
+ // Is an admin logged in?
+ if (isAdmin()) {
+ // Then output admin message
+ $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXTENSION_INACTIVE'), $ext_name, $ext_name, $ext_ver);
+ } // END - if
+
+ // Return prepared message
+ return $message;
+}
+
// Generates a 'extension foo inactive' message
function generateExtensionInactiveMessage ($ext_name) {
// Is the extension empty?
@@ -1312,12 +1346,12 @@ function linenumberCode ($code) {
$count_lines = count($codeE);
$r = 'Line | Code: ';
- foreach($codeE as $line => $c) {
+ foreach ($codeE as $line => $c) {
$r .= '
';
if ($count_lines == 1) {
$r .= 1;
} else {
- $r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
+ $r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
}
$r .= '|';
@@ -1373,7 +1407,7 @@ function determinePageTitle () {
// Installation mode
$pageTitle = '{--INSTALLER_OF_MAILER--}';
} else {
- // Configuration not found!
+ // Configuration not found
$pageTitle = '{--NO_CONFIG_FOUND_TITLE--}';
// Do not add the fatal message in installation mode
@@ -1440,7 +1474,7 @@ function escapeQuotes ($str, $single = false) {
$str = addslashes($str);
} else {
// Remove escaping of single quotes
- $str = str_replace("\'", "'", $str);
+ $str = str_replace("\\'", "'", $str);
// Escape only double-quotes but prevent double-quoting
$str = str_replace("\\\\", "\\", str_replace('"', "\\\"", $str));
@@ -1564,11 +1598,11 @@ function sendModeMails ($mod, $modes) {
}
// Load template
- loadTemplate('admin_settings_saved', false, $content['message']);
+ displayMessage($content['message']);
}
// Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
+function generateSelectionBoxFromArray (array $options, $name, $optionValue, $optionContent = '', $extraName = '') {
// Start the output
$OUT = '