diff --git a/VERSION.txt b/VERSION.txt index 9e11c84c9..3486c52b6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.8.2171 \ No newline at end of file +0.10.8.2176 \ No newline at end of file diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 8618524c3..b2c96aff9 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1076,7 +1076,7 @@ class DboSource extends DataSource { $out = array(); $operator = null; - $bool = array('and', 'or', 'and not', 'or not'); + $bool = array('and', 'or', 'and not', 'or not', 'xor', '||', '&&'); foreach ($conditions as $key => $value) { diff --git a/cake/libs/model/dbo/dbo_mysql.php b/cake/libs/model/dbo/dbo_mysql.php index 66a98d69d..ee3e0ef7c 100644 --- a/cake/libs/model/dbo/dbo_mysql.php +++ b/cake/libs/model/dbo/dbo_mysql.php @@ -283,6 +283,7 @@ class DboMysql extends DboSource function value ($data, $column = null, $safe = false) { $parent = parent::value($data, $column); + if ($parent != null) { return $parent; @@ -292,15 +293,21 @@ class DboMysql extends DboSource { return 'NULL'; } + + if($data == '') + { + return "''"; + } + if (ini_get('magic_quotes_gpc') == 1) { $data = stripslashes($data); } + $data = mysql_real_escape_string($data, $this->connection); + if ($column == null) { - $data = mysql_real_escape_string($data, $this->connection); - if(!is_numeric($data) || $safe == true) { $return = "'" . $data . "'"; @@ -311,9 +318,10 @@ class DboMysql extends DboSource } return $return; - } else { - - $colData = $this->columns[$column]; + } + else + { + $colData = $this->columns[$column]; if (isset($colData['limit']) && strlen(strval($data)) > $colData['limit']) { $data = substr(strval($data), 0, $colData['limit']); @@ -323,12 +331,16 @@ class DboMysql extends DboSource { $data = $this->__formatColumnData($data, $colData); } - - switch($column) { + + switch($column) + { + case 'integer': + case 'int': + return $data; + break; case 'string': case 'text': case 'binary': - return "'" . mysql_real_escape_string($data, $this->connection) . "'"; case 'date': case 'time': case 'datetime': diff --git a/cake/libs/model/model_php4.php b/cake/libs/model/model_php4.php index c484f157a..a307be7bf 100644 --- a/cake/libs/model/model_php4.php +++ b/cake/libs/model/model_php4.php @@ -769,7 +769,7 @@ class Model extends Object $conditions = $this->db->conditions($conditions); } - if ($data = $this->find($conditions, $name, $order)) + if ($data = $this->find($conditions, $name, $order, 0)) { if (isset($data[$this->name][$name])) { diff --git a/cake/libs/model/model_php5.php b/cake/libs/model/model_php5.php index 8ba93d478..4b14605ad 100644 --- a/cake/libs/model/model_php5.php +++ b/cake/libs/model/model_php5.php @@ -765,7 +765,7 @@ class Model extends Object $conditions = $this->db->conditions($conditions); } - if ($data = $this->find($conditions, $name, $order)) + if ($data = $this->find($conditions, $name, $order, 0)) { if (isset($data[$this->name][$name])) { diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index f7ab44b67..120c6ba51 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -532,6 +532,20 @@ class View extends Object { $type = null; } + + $position = strpos($action, '..'); + if ($position === false) + { + } + else + { + $action = explode('/', $action); + $i = array_search('..', $action); + unset($action[$i-1]); + unset($action[$i]); + $action = '..'.DS.implode(DS, $action); + } + $viewFileName = VIEWS.$this->viewPath.DS.$this->subDir.$type.$action.$this->ext; if(file_exists(VIEWS.$this->viewPath.DS.$this->subDir.$type.$action.$this->ext)) @@ -550,13 +564,7 @@ class View extends Object { } - - $viewPath = explode(DS, $viewFileName); - $i = array_search('..', $viewPath); - unset($viewPath[$i-1]); - unset($viewPath[$i]); - $return = '/'.implode('/', $viewPath); - return $return; + return $viewFileName; } /**