From 8d3287bd5bec9bea3b70d385cd4ebdac614b24ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Skej=C3=B8?= Date: Wed, 10 Dec 2008 12:48:40 +0100 Subject: [PATCH] Bugfixes --- AOOSStorageDevice.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AOOSStorageDevice.php b/AOOSStorageDevice.php index 4cc0ca2..72bd354 100644 --- a/AOOSStorageDevice.php +++ b/AOOSStorageDevice.php @@ -327,6 +327,9 @@ class AOOSStorageDevice extends AOOSModule } } + if ($model->rows() == 0) { + return false; + } return $model; } @@ -338,7 +341,7 @@ class AOOSStorageDevice extends AOOSModule */ public function updateFromModel(&$model, $where) { - if (!$this->_checkDevice() || !$this->_checkModel($model)) + if (!$this->_checkDevice() || !$this->_checkModel($model) || !$this->_checkWhere($where)) { return false; } @@ -491,7 +494,7 @@ class AOOSStorageDevice extends AOOSModule public function setSort($sort) { $sort = strtoupper($sort); - if ($sort != "ASC" || $sort != "DESC") { + if ($sort != "ASC" && $sort != "DESC") { throw new AOOSException($this->core(), $this->tr("not_ASC_or_DESC"), "", true, 1); return false; } -- 2.11.4.GIT