Fix #3: Compare full referer domain
This commit is contained in:
parent
f8ab4214de
commit
993d0dd54c
@ -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
|
||||
|
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user