Commit db116d05 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(smarty) Merge if statements (sonar fix)

issue #5831
Showing with 3 additions and 4 deletions
+3 -4
...@@ -43,10 +43,9 @@ function smarty_block_render($params, $text) ...@@ -43,10 +43,9 @@ function smarty_block_render($params, $text)
} }
/* Disable objects, but keep those active that have mode=read_active */ /* 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 (!(isset($params['mode']) && ($params['mode'] == 'read_active') && preg_match('/(r|w)/', $acl))
if (!preg_match('/ disabled(="disabled")?( |\/?>)/', $text)) { && !preg_match('/ disabled(="disabled")?( |\/?>)/', $text)) {
$text = preg_replace('/name=/i', 'disabled="disabled" name=', $text); $text = preg_replace('/name=/i', 'disabled="disabled" name=', $text);
}
} }
/* Read only */ /* Read only */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment