]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Strings.php
Add more Strings::isHex() checks to photos
[friendica.git] / src / Util / Strings.php
index 14fbde899c2dad26a86b2784a0e24f698f9108fc..88dd1d39f81edd151151dac1ba6b7449528dd871 100644 (file)
@@ -40,7 +40,7 @@ class Strings
         */
     public static function isHex($hexCode)
     {
-           return @preg_match("/^[a-f0-9]{2,}$/i", $hexCode) && !(strlen($hexCode) & 1);
+           return !empty($hexCode) ? @preg_match("/^[a-f0-9]{2,}$/i", $hexCode) && !(strlen($hexCode) & 1) : false;
     }
 
     /**