Changeset 128 for trunk/trax/vendor/trax/active_record.php
- Timestamp:
- 02/05/06 23:31:53 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/active_record.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/active_record.php
r117 r128 539 539 540 540 if(is_array($id)) { 541 return /*$this->*/find_all($conditions, $orderings, $limit, $joins);541 return $this->find_all($conditions, $orderings, $limit, $joins); 542 542 } else { 543 543 return $this->find_first($conditions, $orderings, $limit, $joins); … … 855 855 function update_attributes($attributes) { 856 856 foreach($attributes as $field => $value) { 857 # datetime parts check857 # datetime / date parts check 858 858 if(preg_match('/^\w+\(.*i\)$/i', $field)) { 859 859 $datetime_key = substr($field, 0, strpos($field, "(")); … … 910 910 $value = $this->check_datetime($key, $value); 911 911 # If the value isn't a function or null quote it. 912 #if(!(preg_match('/^\w+\(.*\)$/U', $value)) && !(strcasecmp($value, 'NULL') == 0)) { 913 # $value = str_replace("\\\"","\"",$value); 914 # $value = str_replace("\'","'",$value); 915 # $value = str_replace("\\\\","\\",$value); 916 # $return[$key] = "'" . addslashes($value) . "'"; 917 #} else { 918 # $return[$key] = $value; 919 #} 920 $return[$key] = self::$db->quoteSmart($value); 912 if(!(preg_match('/^\w+\(.*\)$/U', $value)) && !(strcasecmp($value, 'NULL') == 0)) { 913 $value = str_replace("\\\"","\"",$value); 914 $value = str_replace("\'","'",$value); 915 $value = str_replace("\\\\","\\",$value); 916 $return[$key] = "'" . addslashes($value) . "'"; 917 } else { 918 $return[$key] = $value; 919 } 920 # quoteSmart is quoting the primary key need to fix this 921 # for now just use the above to quote fields 922 # $return[$key] = self::$db->quoteSmart($value); 921 923 } 922 924 return $return;
