Completed
Pull Request — master (#106)
by
unknown
05:48
created
src/Http/Middleware/LaravelCaffeineDripMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
         $content = $response->getContent();
14 14
 
15
-        if (! is_string($content) || strlen(trim($content)) === 0) {
15
+        if (!is_string($content) || strlen(trim($content)) === 0) {
16 16
             return $response;
17 17
         }
18 18
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
         $metaTokenRegexp = $this->makeRegex([
35 35
             "<meta.*?name\s*=\s*[\'\"]csrf[_-]token[\'\"]",
36 36
         ]);
37
-        $hasNoFormToken = ! preg_match($formTokenRegexp, $content);
38
-        $hasNoMetaToken = ! preg_match($metaTokenRegexp, $content);
37
+        $hasNoFormToken = !preg_match($formTokenRegexp, $content);
38
+        $hasNoMetaToken = !preg_match($metaTokenRegexp, $content);
39 39
 
40 40
         if ($hasNoFormToken && $hasNoMetaToken) {
41 41
             return $response;
@@ -58,6 +58,6 @@  discard block
 block discarded – undo
58 58
 
59 59
     protected function makeRegex(array $regexp) : string
60 60
     {
61
-        return '/' . implode('', $regexp) . '/';
61
+        return '/' . implode('', $regexp) . ' / ';
62 62
     }
63 63
 }
Please login to merge, or discard this patch.