Skip to content
Snippets Groups Projects
Commit d39e4aaf authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Erster Schritt: User-Agent anonymisiert

parent fed7821a
No related branches found
No related tags found
2 merge requests!73Updates from Master,!71Resolve "Anonymisierung der Nutzerdaten abschließen"
......@@ -15,6 +15,7 @@ class MetaGerSearch extends Controller
{
public function search(Request $request, MetaGer $metager)
{
#die($request->header('User-Agent'));
$time = microtime();
# Mit gelieferte Formulardaten parsen und abspeichern:
$metager->parseFormData($request);
......
......@@ -462,6 +462,8 @@ class MetaGer
}
$this->agent = new Agent();
$this->mobile = $this->agent->isMobile();
if($this->mobile)
die("test");
#Sprüche
$this->sprueche = $request->input('sprueche', 'off');
if($this->sprueche === "off" )
......
......@@ -12,6 +12,20 @@
if( !isset($_SERVER['HTTP_X_FORWARDED_FOR'] ))
{
$_SERVER['REMOTE_ADDR'] = substr($_SERVER['REMOTE_ADDR'], 0, strrpos($_SERVER['REMOTE_ADDR'], ".")) . ".0";
$_SERVER['HTTP_USER_AGENT'] = preg_replace("/\(.*\)/s", "( )", $_SERVER['HTTP_USER_AGENT']);
$agentPieces = explode(" ", $_SERVER['HTTP_USER_AGENT']);
for($i = 0; $i < count($agentPieces); $i++)
{
#$agentPieces[$i] = preg_quote($agentPieces[$i], "/");
$agentPieces[$i] = preg_replace("/([^\/]*)\/[^\/]*/s", "$1/0.0", $agentPieces[$i]);
#$agentPieces[$i] = "test";
}
$_SERVER['HTTP_USER_AGENT'] = implode(" ", $agentPieces);
#$_SERVER['HTTP_USER_AGENT'] = preg_replace("/(\b[^\/\s]*)[\B]*/s", "$1", $_SERVER['HTTP_USER_AGENT']);
#$_SERVER['HTTP_USER_AGENT'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 23);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment