X-Git-Url: https://git.cweiske.de/ouya-imagestore.git/blobdiff_plain/9cfd31d1aa1990a1ce4200678b20ec42dd43330f..c706938dba93562cfea0c0932942510e9dfff750:/src/imagestore/Controller/Api.php diff --git a/src/imagestore/Controller/Api.php b/src/imagestore/Controller/Api.php index 91e4373..fe0d2d9 100644 --- a/src/imagestore/Controller/Api.php +++ b/src/imagestore/Controller/Api.php @@ -1,12 +1,12 @@ error(404, 'Only API v1 supported'); + return $this->error(404, 'Only API v1 supported'); } $rest = substr($uri, 3); @@ -14,6 +14,10 @@ class Controller_Api $actionName = $parts[0]; $class = 'imagestore\Controller_Api_' . ucfirst($actionName); + if (!class_exists($class)) { + return $this->error(404, 'API method not supported'); + } + $action = new $class(); $action->handle(substr($rest, strlen($parts[0]) + 1)); }