X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Ffunctions.php;h=944d0281ee1c328c72142c28e21758554711eb7c;hb=1551e5820800685c80c19871a376986c0ad6f0f6;hp=ac5ba52a509e8f17c562815321b59f93520b707e;hpb=6c0abc9f643c69610fe87be0ddb1a5dab95c6d39;p=mailer.git
diff --git a/inc/functions.php b/inc/functions.php
index ac5ba52a50..944d0281ee 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -405,7 +405,9 @@ function translateGender ($gender) {
// Male/female or company?
switch ($gender) {
- case 'M', 'M', 'C':
+ case 'M': // Male
+ case 'F': // Female
+ case 'C': // Company
$ret = sprintf("{--GENDER_%s--}", $gender);
break;
@@ -1196,7 +1198,7 @@ function generateHash ($plainText, $salt = '', $hash = true) {
}
// Scramble a string
-function scrambleString($str) {
+function scrambleString ($str) {
// Init
$scrambled = '';
@@ -1231,7 +1233,7 @@ function scrambleString($str) {
}
// De-scramble a string scrambled by scrambleString()
-function descrambleString($str) {
+function descrambleString ($str) {
// Scramble only 40 chars long strings
if (strlen($str) != 40) return $str;
@@ -1359,7 +1361,7 @@ function getCurrentTheme () {
}
// Generates an error code from given account status
-function generateErrorCodeFromUserStatus ($status='') {
+function generateErrorCodeFromUserStatus ($status = '') {
// If no status is provided, use the default, cached
if ((empty($status)) && (isMember())) {
// Get user status
@@ -1505,9 +1507,9 @@ function getMessageFromErrorCode ($code) {
// Finally contruct the message
// @TODO Rewrite this old lost code to a template
- $message = "{--MEMBER_URL_TIME_LOCK--}
{--CONFIG_URL_TLOCK--} ".$STD."
- {--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}
- {--MEMBER_LAST_TLOCK--}: ".$timestamp;
+ $message = '{--MEMBER_URL_TIME_LOCK--}
{--CONFIG_URL_TLOCK--} ' . $STD . '
+ {--_HOURS--}, ' . $MIN . ' {--_MINUTES--} {--_AND--} ' . $SEC . ' {--_SECONDS--}
+ {--MEMBER_LAST_TLOCK--}: ' . $timestamp;
break;
default:
@@ -1573,9 +1575,9 @@ function isUrlValidSimple ($url) {
// Debug regex?
if (isDebugRegularExpressionEnabled()) {
// @TODO Are these convertions still required?
- $pat = str_replace('.', "\.", $pat);
- $pat = str_replace('@', "\@", $pat);
- //* DEBUG: */ debugOutput($key."= " . $pat);
+ $pat = str_replace('.', '\.', $pat);
+ $pat = str_replace('@', '\@', $pat);
+ //* DEBUG: */ debugOutput($key . '= ' . $pat);
} // END - if
// Check if expression matches
@@ -1790,7 +1792,7 @@ function handleLoginFailures ($accessLevel) {
// Ignore zero values
if (getSession('mailer_' . $accessLevel . '_failures') > 0) {
// Non-guest has login failures found, get both data and prepare it for template
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "accessLevel={$accessLevel}
");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'accessLevel=' . $accessLevel . '
');
$content = array(
'login_failures' => 'mailer_' . $accessLevel . '_failures',
'last_failure' => generateDateTime(getSession('mailer_' . $accessLevel . '_last_failure'), 2)
@@ -2056,7 +2058,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
$excludeArray[] = '.svn';
$excludeArray[] = '.htaccess';
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix} - Entered!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ' - Entered!');
// Init includes
$files = array();
@@ -2099,20 +2101,20 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
continue;
} elseif (substr($baseFile, 0, strlen($prefix)) != $prefix) {
// Skip this file
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "Invalid prefix in file " . $baseFile . ", prefix=" . $prefix);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Invalid prefix in file ' . $baseFile . ', prefix=' . $prefix);
continue;
} elseif ((!empty($suffix)) && (substr($baseFile, -(strlen($suffix . $extension)), (strlen($suffix . $extension))) != $suffix . $extension)) {
// Skip wrong suffix as well
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "Invalid suffix in file " . $baseFile . ", suffix=" . $suffix);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Invalid suffix in file ' . $baseFile . ', suffix=' . $suffix);
continue;
} elseif (!isFileReadable($FQFN)) {
// Not readable so skip it
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "File " . $FQFN . " is not readable!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File ' . $FQFN . ' is not readable!');
continue;
}
// Is the file a PHP script or other?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ',baseFile=' . $baseFile);
if ((substr($baseFile, -4, 4) == '.php') || (($fileIncludeDirs === true) && (isDirectory($FQFN)))) {
// Is this a valid include file?
if ($extension == '.php') {