diff --git a/include/class_CSRFProtection.inc b/include/class_CSRFProtection.inc
index dec9a5b172ca72d8e9f86a4ffc6881f8a1a377d3..a2d8148889e33f720c0aeec3a188e0c898a7f6ac 100644
--- a/include/class_CSRFProtection.inc
+++ b/include/class_CSRFProtection.inc
@@ -61,10 +61,8 @@ class CSRFProtection
       if (!empty($_SERVER['HTTP_HOST'])) {
         $target = $_SERVER['HTTP_HOST'];
       }
-      if ($target) {
-        if (!hash_equals($origin, $target)) {
-          throw new FusionDirectoryException('CSRF detected: origin and target are not matching ('.$origin.' != '.$target.')');
-        }
+      if ($target && !hash_equals($origin, $target)) {
+        throw new FusionDirectoryException('CSRF detected: origin and target are not matching ('.$origin.' != '.$target.')');
       }
     }
   }