From db116d0584dbb0ece00c4c5308590f877a010286 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Mon, 7 May 2018 09:58:13 +0200
Subject: [PATCH] :ambulance: fix(smarty) Merge if statements (sonar fix)

issue #5831
---
 contrib/smarty/plugins/block.render.php | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/contrib/smarty/plugins/block.render.php b/contrib/smarty/plugins/block.render.php
index 892dff297..cbb2a2321 100644
--- a/contrib/smarty/plugins/block.render.php
+++ b/contrib/smarty/plugins/block.render.php
@@ -43,10 +43,9 @@ function smarty_block_render($params, $text)
   }
 
   /* Disable objects, but keep those active that have mode=read_active */
-  if (!(isset($params['mode']) && ($params['mode'] == 'read_active') && preg_match('/(r|w)/', $acl))) {
-    if (!preg_match('/ disabled(="disabled")?( |\/?>)/', $text)) {
-      $text = preg_replace('/name=/i', 'disabled="disabled" name=', $text);
-    }
+  if (!(isset($params['mode']) && ($params['mode'] == 'read_active') && preg_match('/(r|w)/', $acl))
+    && !preg_match('/ disabled(="disabled")?( |\/?>)/', $text)) {
+    $text = preg_replace('/name=/i', 'disabled="disabled" name=', $text);
   }
 
   /* Read only */
-- 
GitLab