From c2fc1402cdff299dcf2c0042f67c67f8ed2f7d14 Mon Sep 17 00:00:00 2001 From: spiderr Date: Sat, 24 Dec 2022 10:47:29 -0500 Subject: count( ref ) check --- includes/bit_setup_inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index 0ceff6a..adb5695 100644 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -31,7 +31,7 @@ if( $gBitSystem->isPackageActive( 'stats' )) { if( !$gBitUser->isRegistered() && !empty( $_SERVER['HTTP_REFERER'] ) && strlen( $_SERVER['HTTP_REFERER'] ) > 9 ) { // Explode the HTTP_REFERER address to split up the string if( $ref = explode('/', $_SERVER['HTTP_REFERER']) ) { - if( $ref[2] != $_SERVER['HTTP_HOST'] ) { + if( count( $ref ) > 1 && $ref[2] != $_SERVER['HTTP_HOST'] ) { // we have a standard refering URL if( empty( $_COOKIE['referer_url'] ) ) { setcookie( 'referer_url', $_SERVER['HTTP_REFERER'], time()+60*60*24*180, $gBitSystem->getConfig( 'cookie_path', BIT_ROOT_URL ), $gBitSystem->getConfig( 'cookie_domain', '' )); -- cgit v1.3