*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 3.0.0
- * @copyright Copyright (c) 2009 - 2011 Cracker Tracker Team
+ * @copyright Copyright (c) 2009 - 2017 Cracker Tracker Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
if (!function_exists('implode_r')) {
// Implode recursive a multi-dimension array, taken from www.php.net
function implode_r ($glue, $array, $array_name = NULL) {
- $return = array();
- while(list($key,$value) = @each($array)) {
- if(is_array($value)) {
+ $return = [];
+ while (list($key,$value) = @each($array)) {
+ if (is_array($value)) {
// Is an array again, so call recursive
$return[] = implode_r($glue, $value, (string) $key);
} else {
- if($array_name != NULL) {
+ if ($array_name != NULL) {
$return[] = $array_name . '[' . (string) $key . ']=' . $value . "\n";
} else {
$return[] = $key . '=' . $value."\n";
} // END - while
// Return resulting array
- return(implode($glue, $return));
+ return implode($glue, $return);
} // END - function
} // END - if
if (!function_exists('implode_secure')) {
// Implode a simple array with a 'call-back' to our escaper function
- function implode_secure ($array) {
+ function implode_secure (array $array) {
// Return string
$return = '';
} // END - if
// Load it
- require($fqfn);
+ require $fqfn;
// Load email header
$GLOBALS['ctracker_header'] = crackerTrackerLoadEmailTemplate('header');
// Is it there?
if (!empty($_SERVER['QUERY_STRING'])) {
- // Return NULL
+ // Get string escaped
$query = crackerTrackerEscapeString(urldecode($_SERVER['QUERY_STRING']));
- } // END - if
+ } elseif (!empty($_SERVER['REQUEST_URI'])) {
+ // Get string escaped
+ $query = crackerTrackerEscapeString(urldecode($_SERVER['REQUEST_URI']));
+ }
// Sanitize it?
- if ($sanitize === TRUE) {
+ if ((!empty($query)) && ($sanitize === TRUE)) {
// Sanitize ...
$query = crackerTrackerSanitize($query);
} // END - if
}
// Loads a given email template and passes through $content
-function crackerTrackerLoadEmailTemplate ($template, array $content = array(), $language = NULL) {
+function crackerTrackerLoadEmailTemplate ($template, array $content = [], $language = NULL) {
// Init language
crackerTrackerLanguage();
'ctracker_language',
'ctracker_localized',
'ctracker_link',
+ 'ctracker_blocked_methods',
) as $key) {
// Unset it
unset($GLOBALS[$key]);