]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Rewrote handling of 'menu adverts' to a filter. This allows e.g. ext-clickbanner...
[mailer.git] / inc / functions.php
index 5d255e12bfe30e6fce3316f314d887e48cb13dac..1935e2a8ccedda9cacd01492dec25e57fe0f4df6 100644 (file)
@@ -648,7 +648,7 @@ function createFancyTime ($stamp) {
        } // END - foreach
 
        // Is something there?
-       if (strlen($ret) > 0) {
+       if (!empty($ret)) {
                // Remove leading commata and space
                $ret = substr($ret, 2);
        } else {
@@ -799,7 +799,9 @@ function scrambleString ($str) {
        }
 
        // Compare both lengths and abort if different
-       if (strlen($str) != count($scrambleNums)) return $str;
+       if (strlen($str) != count($scrambleNums)) {
+               return $str;
+       } // END - if
 
        // Scramble string here
        //* DEBUG: */ debugOutput('***Original=' . $str.'***<br />');
@@ -904,7 +906,7 @@ function encodeHashForCookie ($passHash) {
 
                        $mod = substr($mod, 0, 2);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'idx=' . $idx . ',part1=' . $part1 . '/part2=' . $part2 . '/mod=' . $mod . '(' . strlen($mod) . ')');
-                       $mod = str_repeat('0', (2 - strlen($mod))) . $mod;
+                       $mod = str_pad($mod, 2, '0', STR_PAD_LEFT);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mod(' . ($idx * 2) . ')=' . $mod . '*');
                        $start += 2;
                        $newHash .= $mod;
@@ -1344,9 +1346,6 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
 
 // Tries to determine if call-back functions and/or extra values shall be parsed
 function doHandleExtraValues ($filterFunctions, $extraValues, $key, $entries, $userIdColumn, $search, $id = NULL) {
-       // $search shall not be NULL
-       assert(!is_null($search));
-
        // Debug mode enabled?
        if (isDebugModeEnabled()) {
                // Debug message
@@ -1829,7 +1828,6 @@ function mapModuleToTable ($moduleName) {
                case 'login': // ... and 'login' the member's menu
                        $moduleName = 'member';
                        break;
-
                // Anything else will not be mapped, silently.
        } // END - switch