From e83f40e9c5a467172a3bf39c4e81174c6d9798db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Skej=C3=B8?= Date: Mon, 25 May 2009 11:35:51 +0200 Subject: [PATCH] Various fixes --- AOOSModel.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AOOSModel.php b/AOOSModel.php index 0853519..b0b84f1 100644 --- a/AOOSModel.php +++ b/AOOSModel.php @@ -239,7 +239,7 @@ class AOOSModel extends AOOSModule { } } if ($props & AOOSMODEL_PROP_DATA_INCREASING && !(AOOSMODEL_PROP_DATA_INCREASING & $ignore)) { - if ($this->rows() == 1 && !$this->getRow(0)->$col) { + if ($this->rows() == 1 && $value) { $value = $value; } elseif ($this->rows() == 1) { @@ -252,7 +252,7 @@ class AOOSModel extends AOOSModule { } if ($props & AOOSMODEL_PROP_UNIQUE && !(AOOSMODEL_PROP_UNIQUE & $ignore)) { $cols = $this->getColumn($col); - if (in_array($value, $cols)) { + if (in_array($value, $cols, true)) { throw new AOOSException($this->core(), $this->tr("not_unique")); return false; } @@ -480,7 +480,7 @@ class AOOSModel extends AOOSModule { $continue = false; } - return $typename; + return $type; } /** @@ -886,7 +886,8 @@ class AOOSModelRow extends AOOSModule implements ArrayAccess { public function match($match) { foreach ($match as $key => $value) { - if (!preg_match($this->_data[$key], "/".$value."/")) { + $matchString = "/".str_replace("/","\/", $value)."/"; + if (!preg_match($matchString, $this->_data[$key])) { return false; } } -- 2.11.4.GIT