Skip to content

Commit 742fba6

Browse files
committed
Code revised with reactor
Applied rules: * SimplifyIfReturnBoolRector * ReduceAlwaysFalseIfOrRector
1 parent f981d63 commit 742fba6

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

lib/functions/common.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,8 @@ function config_get($config_id, $default = null)
691691
function isBlank($p_var)
692692
{
693693
$p_var = trim($p_var);
694-
$str_len = strlen($p_var);
695-
if (0 == $str_len) {
696-
return true;
697-
}
698-
return false;
694+
$str_len = strlen($p_var);
695+
return 0 == $str_len;
699696
}
700697

701698
/**

lib/functions/string_api.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,9 @@ function string_prepare_header($p_string)
494494
* @param string $p_string
495495
* @return boolean
496496
*/
497-
function string_contains_scripting_chars($p_string)
498-
{
499-
if ((strstr($p_string, '<') !== false) || (strstr($p_string, '>') !== false)) {
500-
return true;
501-
}
502-
503-
return false;
497+
function string_contains_scripting_chars($p_string)
498+
{
499+
return (strstr($p_string, '<') !== false) || (strstr($p_string, '>') !== false);
504500
}
505501

506502
/**

lib/functions/tree.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ public function nodeNameExists($name, $node_type_id, $id = null,
13431343
$parentNodeID = intval($parent_id);
13441344
if (! is_null($id)) {
13451345
// Try to get parent id if not provided on method call.
1346-
if (is_null($parentNodeID) || $parentNodeID <= 0) {
1346+
if ($parentNodeID <= 0) {
13471347
$sql = "/* {$debugMsg} */ " .
13481348
" SELECT parent_id FROM {$this->object_table} NHA " .
13491349
" WHERE NHA.id = " . $this->db->prepare_int($id);

0 commit comments

Comments
 (0)