Adding val_blob(..) checker

This commit is contained in:
Pavel Shevaev 2023-07-05 15:22:45 +03:00
parent 55f8b0dea9
commit 97507efb23
1 changed files with 10 additions and 0 deletions

View File

@ -182,3 +182,13 @@ function val_enum($enum, $val, $check_enum_validity = true)
return $val;
}
function val_blob($val)
{
if(is_null($val))
return $val;
if(!is_string($val))
throw new Exception("Bad item, not a blob string(" . serialize($val) . ")");
return $val;
}