mirror of
https://github.com/getgrav/grav.git
synced 2026-02-05 14:20:32 +01:00
add do not track header detection (#2334)
This commit is contained in:
@@ -134,4 +134,19 @@ class Browser
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if “Do Not Track” is set by browser
|
||||
* @see https://www.w3.org/TR/tracking-dnt/
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isTrackable(): bool
|
||||
{
|
||||
if ($_SERVER['HTTP_DNT'] === '1') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user