From 2eaf2a1f3647b2593513db1dc823ad26ee4082d0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 11 Feb 2018 10:26:33 +0300 Subject: [PATCH] tag_is_valid: simplify code --- include/functions.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/functions.php b/include/functions.php index 8a869dc0..ebf4021a 100755 --- a/include/functions.php +++ b/include/functions.php @@ -1753,11 +1753,8 @@ } function tag_is_valid($tag) { - if ($tag == '') return false; - if (is_numeric($tag)) return false; - if (mb_strlen($tag) > 250) return false; - - if (!$tag) return false; + if (!$tag || is_numeric($tag) || mb_strlen($tag) > 250) + return false; return true; } -- 2.39.2