|
|
|
@ -100,6 +100,9 @@ function arg($arg, $default=null, $validator=null) {
|
|
|
|
|
} else if (strpos($arg,'b64:') === 0) {
|
|
|
|
|
$type = 'base64';
|
|
|
|
|
$arg = substr($arg, 4);
|
|
|
|
|
} else if (strpos($arg,'set:') === 0) {
|
|
|
|
|
$type = 'exists';
|
|
|
|
|
$arg = substr($arg, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$ps = explode('.', $arg);
|
|
|
|
@ -116,6 +119,9 @@ function arg($arg, $default=null, $validator=null) {
|
|
|
|
|
if ($arr === null)
|
|
|
|
|
$arr = $ps[0];
|
|
|
|
|
eval('$value = isset($'.$arr.'["'.$ps[1].'"]) ? $'.$arr.'["'.$ps[1].'"] : null;');
|
|
|
|
|
|
|
|
|
|
if ($type === 'exists')
|
|
|
|
|
return $value !== null;
|
|
|
|
|
if ($value === null)
|
|
|
|
|
return !$require ? $default : apiresult(['error' => '<'.$arg.'> parameter must be specified'], 400);
|
|
|
|
|
|
|
|
|
|