diff --git a/src/data_utils.inc.php b/src/data_utils.inc.php index a28a514..c494dad 100644 --- a/src/data_utils.inc.php +++ b/src/data_utils.inc.php @@ -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; +}