From: Roland Häder Date: Wed, 16 Dec 2009 19:45:35 +0000 (+0000) Subject: Fixes/rewrites for content-type X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8fc1c99d323e7599dd91071a5a772261b5d079a7;p=mailer.git Fixes/rewrites for content-type --- diff --git a/admin.php b/admin.php index b2c5768b7e..629a255f76 100644 --- a/admin.php +++ b/admin.php @@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // Is the admin logged-in and no sql_patches installed? if ((isAdmin()) && (!isExtensionActive('sql_patches'))) { diff --git a/agb.php b/agb.php index 102f160db8..fb1630b884 100644 --- a/agb.php +++ b/agb.php @@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // Simply redirect... :-) redirectToUrl('modules.php?module=index&what=agb'); diff --git a/confirm.php b/confirm.php index b413408732..84c94b6865 100644 --- a/confirm.php +++ b/confirm.php @@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // No hash provided by default $URL = 'modules.php?module=index'; diff --git a/inc/functions.php b/inc/functions.php index 744aadb9f4..dcdf01e71c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2292,11 +2292,8 @@ function app_die ($F, $L, $message) { // Make sure, that the script realy realy diese here and now $GLOBALS['app_died'] = true; - // Set content type if not set - if (!isContentTypeSet()) { - // text/html is the right one - setContentType('text/html'); - } // END - if + // Set content type as text/html + setContentType('text/html'); // Load header loadIncludeOnce('inc/header.php'); diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index 019b564842..24c0db7dbb 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -39,7 +39,7 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point addMenuDescription('admin', __FILE__); @@ -97,7 +97,7 @@ if (isExtensionActive('online')) { // Remember rows and fancy time in array $content['rows'] = $OUT; - $content['online_timeout'] = getMaskedMessage('ONLINE_TIMEOUT_IS'); + $content['online_timeout'] = getMessage('ONLINE_TIMEOUT_IS'); // Load footer template loadTemplate('admin_list_online', false, $content); diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 827231b499..98c7d4ee98 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -61,46 +61,49 @@ if ((isFormSent()) && (isRegistrationDataComplete())) { // Output success registration loadTemplate('admin_settings_saved', false, getMessage('REGISTRATION_DONE')); } else { - if (postRequestParameter('agree') == '!') { - registerOutputFailedMessage('HAVE_TO_AGREE'); - } // END - if - - if (postRequestParameter('email') == '!') { - registerOutputFailedMessage('ENTER_EMAIL'); - setPostRequestParameter('email', ''); - } elseif (postRequestParameter('email') == '?') { - registerOutputFailedMessage('EMAIL_ALREADY_DB'); - setPostRequestParameter('email', ''); - } - - if (postRequestParameter('surname') == '!') { - registerOutputFailedMessage('ENTER_SURNAME'); - setPostRequestParameter('surname', ''); - } // END - if - - if (postRequestParameter('family') == '!') { - registerOutputFailedMessage('ENTER_FAMILY'); - setPostRequestParameter('family', ''); - } // END - if - - if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) { - registerOutputFailedMessage('ENTER_BOTH_PASSWORDS'); - } elseif (postRequestParameter('pass1') == '!') { - registerOutputFailedMessage('ENTER_PASS1'); - } elseif (postRequestParameter('pass2') == '!') { - registerOutputFailedMessage('ENTER_PASS2'); - } - - if ($GLOBALS['registration_short_password'] === true) { - registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len')); - } // END - if - - if ($GLOBALS['registration_ip_timeout'] === true) { - registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT'); - } // END - if - - if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) { - registerOutputFailedMessage('', getMessage('CATS_LEAST')); + // Do this only if form is sent + if (isFormSent()) { + if (postRequestParameter('agree') == '!') { + registerOutputFailedMessage('HAVE_TO_AGREE'); + } // END - if + + if (postRequestParameter('email') == '!') { + registerOutputFailedMessage('ENTER_EMAIL'); + setPostRequestParameter('email', ''); + } elseif (postRequestParameter('email') == '?') { + registerOutputFailedMessage('EMAIL_ALREADY_DB'); + setPostRequestParameter('email', ''); + } + + if (postRequestParameter('surname') == '!') { + registerOutputFailedMessage('ENTER_SURNAME'); + setPostRequestParameter('surname', ''); + } // END - if + + if (postRequestParameter('family') == '!') { + registerOutputFailedMessage('ENTER_FAMILY'); + setPostRequestParameter('family', ''); + } // END - if + + if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) { + registerOutputFailedMessage('ENTER_BOTH_PASSWORDS'); + } elseif (postRequestParameter('pass1') == '!') { + registerOutputFailedMessage('ENTER_PASS1'); + } elseif (postRequestParameter('pass2') == '!') { + registerOutputFailedMessage('ENTER_PASS2'); + } + + if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) { + registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len')); + } // END - if + + if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === true)) { + registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT'); + } // END - if + + if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) { + registerOutputFailedMessage('', getMessage('CATS_LEAST')); + } // END - if } // END - if // Generate birthday selection diff --git a/js.php b/js.php index 6cdea2a1c6..b12d5270ed 100644 --- a/js.php +++ b/js.php @@ -55,11 +55,11 @@ $GLOBALS['module'] = 'js'; // Load the required file(s) require('inc/config-global.php'); +// Set header +setContentType('text/javascript'); + // Is 'js' is provied? if (isGetRequestParameterSet('js')) { - // Set header - setContentType('text/javascript'); - // Load header loadIncludeOnce('inc/header.php'); diff --git a/ref.php b/ref.php index f3fa2597bb..a475c51ace 100644 --- a/ref.php +++ b/ref.php @@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // No refid by default $URL = 'modules.php?module=index'; diff --git a/sponsor_confirm.php b/sponsor_confirm.php index 875728f9b0..c6301e3275 100644 --- a/sponsor_confirm.php +++ b/sponsor_confirm.php @@ -48,7 +48,7 @@ $GLOBALS['output_mode'] = -2; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // No hash provided by default $URL = 'modules.php?module=index'; diff --git a/sponsor_ref.php b/sponsor_ref.php index 6fccdfda70..8f732c086c 100644 --- a/sponsor_ref.php +++ b/sponsor_ref.php @@ -48,7 +48,7 @@ $GLOBALS['output_mode'] = -2; require('inc/config-global.php'); // Set content type for e.g. search engines -if (isSpider()) setContentType('text/html'); +setContentType('text/html'); // Base URL for redirection $URL = 'modules.php?module=index&what=sponsor_reg&refid=';