From 168955135b22f1650680b90bcee4b1a13f06e081 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 10 Jun 2015 13:49:52 +1200 Subject: [PATCH] Fix the order of params The parameters for the strpos and substr functions were wrong. strpos always failed so never triggered the substr. This would mean $fieldClass would be left with 'Varchar(255)' Fixing this had no speed or memory effect. --- model/DataObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/DataObject.php b/model/DataObject.php index 88132c894..7f14288f8 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -358,8 +358,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity if(!is_string($fieldClass)) continue; // Strip off any parameters - $bPos = strpos('(', $fieldClass); - if($bPos !== FALSE) $fieldClass = substr(0,$bPos, $fieldClass); + $bPos = strpos($fieldClass, '('); + if($bPos !== FALSE) $fieldClass = substr($fieldClass, 0, $bPos); // Test to see if it implements CompositeDBField if(ClassInfo::classImplements($fieldClass, 'CompositeDBField')) {