From 993d0dd54c02b6f9704b3113a359e59b0c79a1ff Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Mon, 29 Aug 2016 10:28:13 +0200 Subject: [PATCH] Fix #3: Compare full referer domain --- README.md | 3 ++- inc/statifyblacklist.class.php | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9499280..74714bd 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ No. It only prevent's _Statify_ from tracking, nothing more or less. ### Does live filtering impact performance? ### Yes, but probalby not noticeable. Checking a single referer string against a (usually small) list should be neglectible compared to the total loading procedure. -If this still is an issue for you, consider deactivating the filter and only run the one-time-cleanup. +If this still is an issue for you, consider deactivating the filter and only run the one-time-cleanup or activate the cron job. ### Is any personal data collected? ### No. The privacy policy of _Statify_ is untouched. Data is only processed, not stored or exposed to anyone. @@ -66,6 +66,7 @@ If you like to have this feature, please leave a feature request in GitHub or th ## Changelog ## ### 1.2.0 / (work in progress) ### * Switched from `in_array()` to faster `isset()` for referer checking +* Optional cron execiton implemented ### 1.1.2 / 17.08.2016 ### * Prepared for localization diff --git a/inc/statifyblacklist.class.php b/inc/statifyblacklist.class.php index 505e2c1..ecaaee6 100644 --- a/inc/statifyblacklist.class.php +++ b/inc/statifyblacklist.class.php @@ -91,6 +91,7 @@ class StatifyBlacklist { * Update options * * @param $options array New options to save + * * @since 1.0.0 * @changed 1.1.1 */ @@ -122,11 +123,11 @@ class StatifyBlacklist { /* Extract relevant domain parts */ $referer = strtolower( ( isset( $_SERVER['HTTP_REFERER'] ) ? parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_HOST ) : '' ) ); $referer = explode( '.', $referer ); - if ( count( $referer ) > 1 ) { - $referer = implode( '.', array_slice( $referer, - 2 ) ); - } else { +// if ( count( $referer ) > 1 ) { +// $referer = implode( '.', array_slice( $referer, - 2 ) ); +// } else { $referer = implode( '.', $referer ); - } +// } /* Get blacklist */ $blacklist = self::$_options['referer'];