Show
Ignore:
Timestamp:
02/05/06 23:31:53 (6 years ago)
Author:
john
Message:

bug fixes for views

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/active_record.php

    r117 r128  
    539539 
    540540        if(is_array($id)) { 
    541             return /*$this->*/find_all($conditions, $orderings, $limit, $joins); 
     541            return $this->find_all($conditions, $orderings, $limit, $joins); 
    542542        } else { 
    543543            return $this->find_first($conditions, $orderings, $limit, $joins); 
     
    855855    function update_attributes($attributes) { 
    856856        foreach($attributes as $field => $value) { 
    857             # datetime parts check 
     857            # datetime / date parts check 
    858858            if(preg_match('/^\w+\(.*i\)$/i', $field)) { 
    859859                $datetime_key = substr($field, 0, strpos($field, "(")); 
     
    910910            $value = $this->check_datetime($key, $value); 
    911911            # 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); 
    921923        } 
    922924        return $return;