From 30ea0fb69b3ba5d015be0dcfe6db2a1079a0bdd3 Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 9 Apr 2007 22:41:17 +0000 Subject: [PATCH] Fixed typo in function name strpos replaces strrpos git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4832 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 17f322003..07b3f7405 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -997,8 +997,8 @@ class DboSource extends DataSource { $assocFields = $this->fields($model, $model->name, array("{$model->name}.{$model->primaryKey}")); $passedFields = $this->fields($model, $model->name, $queryData['fields']); if(count($passedFields) === 1) { - $match = strrpos($passedFields[0], $assocFields[0]); - $match1 = strrpos($passedFields[0], 'COUNT('); + $match = strpos($passedFields[0], $assocFields[0]); + $match1 = strpos($passedFields[0], 'COUNT('); if($match === false && $match1 === false){ $queryData['fields'] = array_unique(array_merge($passedFields, $assocFields)); } else { @@ -1425,12 +1425,12 @@ class DboSource extends DataSource { $prepend = 'DISTINCT '; $fields[$i] = trim(r('DISTINCT', '', $fields[$i])); } - $dot = strrpos($fields[$i], '.'); + $dot = strpos($fields[$i], '.'); if ($dot === false) { $fields[$i] = $prepend . $this->name($alias) . '.' . $this->name($fields[$i]); } else { - $comma = strrpos($fields[$i], ','); + $comma = strpos($fields[$i], ','); if ($comma === false) { $build = explode('.', $fields[$i]); if (!Set::numeric($build)) { @@ -1449,7 +1449,7 @@ class DboSource extends DataSource { } } elseif (preg_match('/\(([\.\w]+)\)/', $fields[$i], $field)) { if (isset($field[1])) { - if (strrpos($field[1], '.') === false) { + if (strpos($field[1], '.') === false) { $field[1] = $this->name($alias) . '.' . $this->name($field[1]); } else { $field[0] = explode('.', $field[1]);