]> git.wh0rd.org Git - tt-rss.git/commitdiff
tag_is_valid: simplify code
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 11 Feb 2018 07:26:33 +0000 (10:26 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 11 Feb 2018 07:26:33 +0000 (10:26 +0300)
include/functions.php

index 8a869dc08a08aa0318655aea05a08cf077ab5199..ebf4021ae627d39261932771d43b2bc816557795 100755 (executable)
        }
 
        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;
        }