From 3a26ace065476fbc9c2537e97bf7720d3648400f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 21:15:44 -0800 Subject: Improve robustness in resolve() against bad urls.. --- modules/rest/helpers/rest.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/rest/helpers') diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index cd3de725..324b7f98 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -75,6 +75,10 @@ class rest_Core { $path = parse_url($relative_url, PHP_URL_PATH); $components = explode("/", $path, 3); + if (count($components) != 3) { + throw new Kohana_404_Exception($url); + } + $class = "$components[1]_rest"; if (!method_exists($class, "resolve")) { throw new Kohana_404_Exception($url); -- cgit v1.2.3