|
|
|
@ -77,7 +77,7 @@ function no_http() {
|
|
|
|
|
|
|
|
|
|
function arg($arg, $default=null, $validator=null) {
|
|
|
|
|
$arg = trim($arg);
|
|
|
|
|
$type = 'string';
|
|
|
|
|
$type = null;
|
|
|
|
|
|
|
|
|
|
$require = false;
|
|
|
|
|
if (strpos($arg,'*') === 0) {
|
|
|
|
@ -116,7 +116,8 @@ function arg($arg, $default=null, $validator=null) {
|
|
|
|
|
if ($value === null)
|
|
|
|
|
return !$require ? $default : apiresult(['error' => '<'.$arg.'> parameter must be specified'], 400);
|
|
|
|
|
|
|
|
|
|
$value = trim($value);
|
|
|
|
|
if (gettype($value) === 'string')
|
|
|
|
|
$value = trim($value);
|
|
|
|
|
if ($type === 'string')
|
|
|
|
|
$value = strval($value);
|
|
|
|
|
else if ($type === 'integer')
|
|
|
|
|