From 27a9c14d274b3d521e5b5571553b0acc2f522d4a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 3 Dec 2008 17:33:18 +0000 Subject: If the the post and get arrays don't contain a _method parameter, then use the request::method() to determine the actual request method (i.e. delete doesn't show up in either places) --- core/helpers/rest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/helpers') diff --git a/core/helpers/rest.php b/core/helpers/rest.php index bb2e8f1a..a0d6e732 100644 --- a/core/helpers/rest.php +++ b/core/helpers/rest.php @@ -57,11 +57,12 @@ class rest_Core { * @return string HTTP request method */ public static function request_method() { + Kohana::log("debug", "request::method: " . request::method()); if (request::method() == "get") { return "get"; } else { $input = Input::instance(); - switch (strtolower($input->post("_method", $input->get("_method")))) { + switch (strtolower($input->post("_method", $input->get("_method", request::method())))) { case "put": return "put"; case "delete": return "delete"; default: return "post"; -- cgit v1.2.3