}
if ($a->argc > 3 && $a->argv[2] === 'album') {
+ if (!Strings::isHex($a->argv[3])) {
+ $a->internalRedirect();
+ }
$album = hex2bin($a->argv[3]);
if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
return;
}
- $selname = $datum ? hex2bin($datum) : '';
+ $selname = Strings::isHex($datum) ? hex2bin($datum) : '';
$albumselect = '';
*/
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;
}
/**