// Init count
$count = '0';
- // Do we have at least the first entry?
+ // Is there at least the first entry?
if (!empty($GLOBALS['fatal_messages'][0])) {
// Get total count
$count = count($GLOBALS['fatal_messages']);
function generateDerefererUrl ($url) {
// Don't de-refer our own links!
if (substr($url, 0, strlen(getUrl())) != getUrl()) {
- // De-refer this link
- $url = '{%url=modules.php?module=loader&url=' . encodeString(compileUriCode($url)) . '%}';
+ // Encode URL
+ $encodedUrl = encodeString(compileUriCode($url));
+
+ // Log plain URL
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'url=' . $url);
+
+ // De-refer this URL
+ $url = '{%url=modules.php?module=loader&url=' . $encodedUrl . '&hash=' . encodeHashForCookie(generateHash($url)) . '%}';
} // END - if
// Return link
// Default 'rel' value is external, nofollow is evil from Google and hurts the Internet
$rel = ' rel="external"';
- // Do we have internal or external URL?
+ // Is there internal or external URL?
if (substr($url, 0, strlen(getUrl())) == getUrl()) {
// Own (=internal) URL
$rel = '';
$len = $length;
} // END - if
- if ($len == '0') {
+ // Smaller 1 is not okay
+ if ($len < 1) {
+ // Fix it to 10
$len = 10;
} // END - if
// Initial return value
$ret = '0';
- // Do we have a leap year?
+ // Is there a leap year?
$SWITCH = '0';
$TEST = getYear() / 4;
$M1 = getMonth();
} // END - if
} // END - foreach
- // Do we have something there?
+ // Is something there?
if (strlen($ret) > 0) {
// Remove leading commata and space
$ret = substr($ret, 2);
}
} // END - if
- // Do we miss an arry element here?
+ // Is an arry element missing here?
if (!isConfigEntrySet('file_hash')) {
// Stop here
reportBug(__FUNCTION__, __LINE__, 'Missing file_hash in ' . __FUNCTION__ . '.');
// The default theme is 'default'... ;-)
$ret = 'default';
- // Do we have ext-theme installed and active or is 'theme' in URL or POST data?
+ // Is there ext-theme installed and active or is 'theme' in URL or POST data?
if (isExtensionActive('theme')) {
// Call inner method
$ret = getActualTheme();
// Default is the value itself
$ret = $value;
- // Do we have a special filter function?
+ // Is there a special filter function?
if (!empty($filterFunction)) {
// Does the filter function exist?
if (function_exists($filterFunction)) {
- // Do we have extra parameters here?
+ // Is there extra parameters here?
if (!empty($extraValue)) {
// Put both parameters in one new array by default
$args = array($value, $extraValue);
// Call the multi-parameter call-back
$ret = call_user_func_array($filterFunction, $args);
+
+ // Is $ret 'true'?
+ if ($ret === true) {
+ // Test passed, so write direct value
+ $ret = $args;
+ } // END - if
} else {
// One parameter call
$ret = call_user_func($filterFunction, $value);
+
+ // Is $ret 'true'?
+ if ($ret === true) {
+ // Test passed, so write direct value
+ $ret = $value;
+ } // END - if
}
} // END - if
} // END - if
$str = str_replace('.', '', $str);
// Replace german commata with decimal dot and cast it
- $float = (float)str_replace(',', '.', $str);
+ $float = (float) str_replace(',', '.', $str);
break;
default: // US and so on
// Remove thousand commatas first and cast
- $float = (float)str_replace(',', '', $str);
+ $float = (float) str_replace(',', '', $str);
break;
} // END - switch
// Add SQL debug data to array for later output
function addSqlToDebug ($result, $sqlString, $timing, $F, $L) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['debug_sql_available'])) {
// Check it and cache it in $GLOBALS
$GLOBALS['debug_sql_available'] = ((isConfigurationLoaded()) && (isDisplayDebugSqlEnabled()));
// Encodes an URL for adding session id, etc.
function encodeUrl ($url, $outputMode = '0') {
- // Do we have already have a PHPSESSID inside or view.php is called? Then abort here
+ // Is there already have a PHPSESSID inside or view.php is called? Then abort here
if ((isInStringIgnoreCase(session_name(), $url)) || (isRawOutputMode())) {
// Raw output mode detected or session_name() found in URL
return $url;
} // END - if
- // Do we have a valid session?
+ // Is there a valid session?
if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
// Determine right separator
$separator = '&';
$url = '{?URL?}/' . $url;
} // END - if
- // Do we have to decode entities?
+ // Is there to decode entities?
if ((!isHtmlOutputMode()) || ($outputMode != '0')) {
// Decode them for e.g. JavaScript parts
$url = decodeEntities($url);
// Capitalizes a string with underscores, e.g.: some_foo_string will become SomeFooString
// Note: This function is cached
function capitalizeUnderscoreString ($str) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$str])) {
// Init target string
$capitalized = '';
bigintval($mailId)
), __FILE__, __LINE__);
- // Do we have one entry there?
+ // Is there one entry there?
if (SQL_NUMROWS($result) == 1) {
// Load the entry
$content = SQL_FETCHARRAY($result);
// Now check all entries
foreach ($needles as $key => $needle) {
- // Do we have found a partial string?
+ // Is there found a partial string?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'heystack='.$heystack.',key='.$key.',needle='.$needle.',offset='.$offset);
if (strpos($heystack, $needle, $offset) !== false) {
// Add the found key
// Debug message (to measure how often this function is called)
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'str=' . $str);
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$str])) {
// Trim it lower-case for validation
$strTrimmed = trim(strtolower($str));
reportBug(__FUNCTION__, __LINE__, 'varString=' . $varString . ' - No dollar sign detected, will not parse it.');
} // END - if
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$varString])) {
// Snap them in, if [,] are there
$GLOBALS[__FUNCTION__][$varString] = str_replace(array('[', ']'), array("['", "']"), $varString);