From 5ada80cd424d37b46c8b36d38a3bc1424da7fe23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 4 Nov 2020 13:35:00 +0100 Subject: [PATCH] Continued: - prevented more local variables and if/else blocks - updated TODOs.txt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- docs/TODOs.txt | 4 ++-- libs/lib_general.php | 22 +++++++--------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/docs/TODOs.txt b/docs/TODOs.txt index 4da2535..0387416 100644 --- a/docs/TODOs.txt +++ b/docs/TODOs.txt @@ -1,5 +1,5 @@ ### WARNING: THIS FILE IS AUTO-GENERATED BY ./todo-builder.sh ### ### DO NOT EDIT THIS FILE. ### -./libs/lib_detector.php:124: // @TODO Misc/unsorted -./libs/lib_general.php:407: // @TODO Why can't domain be set to value from crackerTrackerServerName() ? +./libs/lib_detector.php:160: // @TODO Misc/unsorted +./libs/lib_general.php:488: // @TODO Why can't domain be set to value from crackerTrackerServerName() ? ### ### DEPRECATION FOLLOWS: ### ### diff --git a/libs/lib_general.php b/libs/lib_general.php index 55a0fde..d6e1a87 100644 --- a/libs/lib_general.php +++ b/libs/lib_general.php @@ -498,20 +498,13 @@ function ifCrackerTrackerCookieIsSet () { // Redirects to the same URL function crackerTrackerRedirectSameUrl () { - // Construct the url - $url = '://' . crackerTrackerServerName() . crackerTrackerScriptName() . '?' . crackerTrackerQueryString(); - - // Do we have SSL? - if (crackerTrackerSecured()) { - // HTTPS - $url = 'https' . $url; - } else { - // HTTP - $url = 'http' . $url; - } - - // And redirect - crackerTrackerSendRawRedirect($url); + // Construct and redirect to same URL + crackerTrackerSendRawRedirect(sprintf('%s://%s%s?%s', + (crackerTrackerSecured() ? 'https' : 'http'), + crackerTrackerServerName(), + crackerTrackerScriptName(), + crackerTrackerQueryString() + )); } /** @@ -522,7 +515,6 @@ function crackerTrackerRedirectSameUrl () { * * @link http://support.microsoft.com/kb/q176113/ * @author Andreas Gohr - * @access private */ function crackerTrackerSendRawRedirect ($url) { // Better remove any data by ctracker -- 2.39.5