Add more Strings::isHex() checks to photos

This commit is contained in:
Philipp Holzer 2019-05-30 10:30:15 +02:00
parent 392137b433
commit 4c5dd9f47c
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
2 changed files with 5 additions and 2 deletions

View 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;
}
/**