diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 8ee861277..6af58fbcc 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -43,6 +43,15 @@ class ModelTask extends Shell { if (empty($this->args)) { $this->__interactive(); } + + if(!empty($this->args[0])) { + $model = $this->args[0]; + if ($this->__bake($model)) { + if ($this->_checkUnitTest()) { + $this->__bakeTest($model); + } + } + } } /** * Handles interactive baking diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index c66d4aa37..ea133e561 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -256,7 +256,11 @@ class RequestHandlerComponent extends Object { * @return bool True if user agent is a mobile web browser */ function isMobile() { - return (preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT')) > 0 || $this->accepts('wap')); + preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT'), $match); + if(!empty($match) || $this->accepts('wap')) { + return true; + } + return false; } /** * Returns true if the client accepts WAP content