diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-20 21:15:44 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-20 21:15:44 -0800 |
commit | 3a26ace065476fbc9c2537e97bf7720d3648400f (patch) | |
tree | 76cdbc961165a05325059a37cdb383a355948172 /modules/rest | |
parent | 697d84457f3013bff1f8e860a1cd27e2e1942642 (diff) |
Improve robustness in resolve() against bad urls..
Diffstat (limited to 'modules/rest')
-rw-r--r-- | modules/rest/helpers/rest.php | 4 |
1 files changed, 4 insertions, 0 deletions
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); |