X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Faction.php;h=81b2283124575c15cbb61ceee0c54d1a031e56ff;hb=5650d698bed8351f4f9c86b615ae89184cec8e94;hp=50370c09feca6086b4b1a68a03f26b9ed174b111;hpb=22577b17edf1d901ed4f8a3089ed539d89e5f1e4;p=quix0rs-gnu-social.git diff --git a/lib/action.php b/lib/action.php index 50370c09fe..81b2283124 100644 --- a/lib/action.php +++ b/lib/action.php @@ -40,11 +40,7 @@ class Action { // lawsuit } function handle($argarray) { - $strip = get_magic_quotes_gpc(); - $this->args = array(); - foreach ($argarray as $k => $v) { - $this->args[$k] = ($strip) ? stripslashes($v) : $v; - } + $this->args =& common_copy_args($argarray); } function boolean($key, $def=false) { @@ -60,4 +56,23 @@ class Action { // lawsuit return $def; } } + + function server_error($msg, $code=500) { + $action = $this->trimmed('action'); + common_debug("Server error '$code' on '$action': $msg", __FILE__); + common_server_error($msg, $code); + } + + function client_error($msg, $code=400) { + $action = $this->trimmed('action'); + common_debug("User error '$code' on '$action': $msg", __FILE__); + common_user_error($msg, $code); + } + + function self_url() { + $action = $this->trimmed('action'); + $args = $this->args; + unset($args['action']); + return common_local_url($action, $args); + } }