mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
"read: prefix column with table-name, if used in join, to prevent ambigous col-name"
This commit is contained in:
parent
cb42383e47
commit
6ffdbb01a1
@ -324,6 +324,15 @@ class so_sql
|
||||
|
||||
return False;
|
||||
}
|
||||
if ($join) // Prefix the columns with the table-name, as they might exist in the join
|
||||
{
|
||||
foreach($query as $col => $val)
|
||||
{
|
||||
if (is_int($col) || strstr($join,$col) === false) continue;
|
||||
$query[] = $this->db->expression($this->table_name,$this->table_name.'.',array($col=>$val));
|
||||
unset($query[$col]);
|
||||
}
|
||||
}
|
||||
$this->db->select($this->table_name,'*'.($extra_cols?','.(is_array($extra_cols)?implode(',',$extra_cols):$extra_cols):''),
|
||||
$query,__LINE__,__FILE__,False,'',False,0,$join);
|
||||
|
||||
@ -785,6 +794,7 @@ class so_sql
|
||||
{
|
||||
$criteria[$col] = $query['search'];
|
||||
}
|
||||
_debug_array($criteria);
|
||||
}
|
||||
$rows = (array) $this->search($criteria,false,$query['order']?$query['order'].' '.$query['sort']:'',
|
||||
'','%',false,'OR',(int)$query['start'],$query['col_filter'],$join,$need_full_no_count);
|
||||
|
Loading…
Reference in New Issue
Block a user