Permalink
Browse files

Fixing notice errors caused by incorrect datatyping in php4.

  • Loading branch information...
1 parent 896414e commit 4ada5b7eea447c76e8af04f2647f409a67cee241 @markstory markstory committed Jan 11, 2010
@@ -1884,7 +1884,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) {
for ($i = 0; $i < $count; $i++) {
- if (in_array($fields[$i], $virtual)) {
+ if (is_string($fields[$i]) && in_array($fields[$i], $virtual)) {
unset($fields[$i]);
continue;
}
@@ -2934,7 +2934,7 @@ function testFieldParsing() {
* @return void
*/
function testFieldsWithExpression() {
- $expression =& $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col");
+ $expression = $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col");
$result = $this->testDb->fields($this->Model, null, array("id", $expression));
$expected = array(
'`TestModel`.`id`',

0 comments on commit 4ada5b7

Please sign in to comment.