mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
php-func fix
This commit is contained in:
parent
dd1efc58a1
commit
beccead388
4 changed files with 34 additions and 14 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
if (!isset($argv)) exit;
|
||||
if (!isset($argv)) exit 5;
|
||||
|
||||
include ("/usr/local/vesta/func/main.php");
|
||||
include ("/usr/local/vesta/func/string.php");
|
||||
|
@ -8,8 +8,11 @@ include ("/usr/local/vesta/func/string.php");
|
|||
$counter=count($argv);
|
||||
if ($counter<2) myvesta_throw_error(2, 'Function is missing');
|
||||
|
||||
$func="myvesta_".$argv[1];
|
||||
if (!function_exists($func)) myvesta_throw_error(2, 'Function does not exists');
|
||||
$func=$argv[1];
|
||||
if (!function_exists($func)) {
|
||||
$func="myvesta_".$argv[1];
|
||||
if (!function_exists($func)) myvesta_throw_error(2, 'Function does not exists');
|
||||
}
|
||||
|
||||
$params=array();
|
||||
|
||||
|
@ -17,5 +20,15 @@ for ($i=2; $i<$counter; $i++) {
|
|||
$argv[$i]=myvesta_fix_backslashes($argv[$i]);
|
||||
$params[]=$argv[$i];
|
||||
}
|
||||
// echo $func."\n"; print_r($params);
|
||||
|
||||
$r=call_user_func_array($func, $params);
|
||||
if (is_bool($r)) {
|
||||
if ($r) {
|
||||
exit(0);
|
||||
} else {
|
||||
exit(MYVESTA_ERROR_GENERAL);
|
||||
}
|
||||
} else {
|
||||
echo $r;
|
||||
exit(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue