]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Extension ext-earning introduced (unfinished), renamings:
[mailer.git] / inc / template-functions.php
index 36212e608afb78e07ef483e34214809f9e596ff6..19d2459be3dd3ef66c99f8b0c25dda9ad6e99ec6 100644 (file)
@@ -182,13 +182,13 @@ function compileFinalOutput () {
        // Compress it?
        /**
         * @TODO On some pages this is buggy
-       if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
+       if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (isInStringIgnoreCase('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']))) {
                // Compress it for HTTP gzip
                $GLOBALS['output'] = gzencode($GLOBALS['output'], 9);
 
                // Add header
                sendHeader('Content-Encoding: gzip');
-       } elseif (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('deflate', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
+       } elseif (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (isInStringIgnoreCase('deflate', $_SERVER['HTTP_ACCEPT_ENCODING']))) {
                // Compress it for HTTP deflate
                $GLOBALS['output'] = gzcompress($GLOBALS['output'], 9);
 
@@ -213,7 +213,7 @@ function doFinalCompilation ($code, $insertComments = true, $enableCodes = true)
        $count = 0;
 
        // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($count < 7)) {
+       while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== false)) && ($count < 7)) {
                // Init common variables
                $content = array();
                $newContent = '';
@@ -314,7 +314,7 @@ function loadTemplate ($template, $return = false, $content = array(), $compileC
 
                        // Do we have to compile the code?
                        $ret = '';
-                       if ((strpos($GLOBALS['tpl_content'][$template], '$') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{--') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{?') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{%') !== false)) {
+                       if ((isInString('$', $GLOBALS['tpl_content'][$template])) || (isInString('{--', $GLOBALS['tpl_content'][$template])) || (isInString('{?', $GLOBALS['tpl_content'][$template])) || (isInString('{%', $GLOBALS['tpl_content'][$template]))) {
                                // Normal HTML output?
                                if (isHtmlOutputMode()) {
                                        // Add surrounding HTML comments to help finding bugs faster
@@ -1253,17 +1253,17 @@ function compileUriCode ($code, $simple = true) {
 // Handle message codes from URL
 function handleCodeMessage () {
        // Is 'code' set?
-       if (isGetRequestParameterSet('code')) {
+       if (isGetRequestElementSet('code')) {
                // Default extension is 'unknown'
                $ext = 'unknown';
 
                // Is extension given?
-               if (isGetRequestParameterSet('ext')) {
-                       $ext = getRequestParameter('ext');
+               if (isGetRequestElementSet('ext')) {
+                       $ext = getRequestElement('ext');
                } // END - if
 
                // Convert the 'code' parameter from URL to a human-readable message
-               $message = getMessageFromErrorCode(getRequestParameter('code'));
+               $message = getMessageFromErrorCode(getRequestElement('code'));
 
                // Load message template
                loadTemplate('message', false, $message);
@@ -1542,7 +1542,7 @@ function sendModeMails ($mod, $modes) {
                $hash = encodeHashForCookie(getUserData('password'));
 
                // Does the hash match or should we change it?
-               if (($hash == getSession('u_hash')) || (postRequestParameter('pass1') == postRequestParameter('pass2'))) {
+               if (($hash == getSession('u_hash')) || (postRequestElement('pass1') == postRequestElement('pass2'))) {
                        // Load the data
                        $content = getUserDataArray();
 
@@ -1557,7 +1557,7 @@ function sendModeMails ($mod, $modes) {
                                                switch ($mode) {
                                                        case 'normal': break; // Do not add any special lines
                                                        case 'email': // Email was changed!
-                                                               $content['message'] = '{--MEMBER_CHANGED_EMAIL--}' . ': ' . postRequestParameter('old_email') . "\n";
+                                                               $content['message'] = '{--MEMBER_CHANGED_EMAIL--}' . ': ' . postRequestElement('old_email') . "\n";
                                                                break;
 
                                                        case 'password': // Password was changed
@@ -1573,7 +1573,7 @@ function sendModeMails ($mod, $modes) {
 
                                        if (isExtensionActive('country')) {
                                                // Replace code with description
-                                               $content['country'] = generateCountryInfo(postRequestParameter('country_code'));
+                                               $content['country'] = generateCountryInfo(postRequestElement('country_code'));
                                        } // END - if
 
                                        // Merge content with data from POST