From 39ea834f65c641ca4489774e8149a97e01ce8349 Mon Sep 17 00:00:00 2001 From: Mike Kruk Date: Tue, 1 Apr 2014 15:57:01 -0400 Subject: [PATCH] Fixing indents. --- lib/Rackem/Protection/JsonCsrf.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Rackem/Protection/JsonCsrf.php b/lib/Rackem/Protection/JsonCsrf.php index 09cede0..c907b53 100644 --- a/lib/Rackem/Protection/JsonCsrf.php +++ b/lib/Rackem/Protection/JsonCsrf.php @@ -8,19 +8,19 @@ public function call($env) { list($status,$headers,$body) = $this->app->call($env); $req = new \Rackem\Request($env); - if ($this->has_vector($req, $headers)) { + if ($this->has_vector($req, $headers)) { $result = $this->react($env); $this->warn($env, "attack prevented by ".get_class($this)); } - return isset($result)? $result : array($status,$headers,$body); - } + return isset($result)? $result : array($status,$headers,$body); + } public function has_vector($req, $headers) { if ($req->is_xhr()) return false; - $content_type = isset($headers['Content-Type'])? explode(';',$headers['Content-Type'],2) : array(''); - if(!preg_match('/^\s*application\/json\s*$/',array_shift($content_type))) return false; + $content_type = isset($headers['Content-Type'])? explode(';',$headers['Content-Type'],2) : array(''); + if(!preg_match('/^\s*application\/json\s*$/',array_shift($content_type))) return false; return $this->referrer($req->env) != $req->host(); }