fix for bug [ 1446067 ] Invalid SQL sorting holidays

This commit is contained in:
Ralf Becker 2006-03-09 22:31:58 +00:00
parent a116120ab8
commit 81a8e89f69
2 changed files with 4 additions and 4 deletions

View File

@ -172,11 +172,11 @@
$querymethod = 'hol_locale LIKE '.$this->db->quote('%'.$query.'%'); $querymethod = 'hol_locale LIKE '.$this->db->quote('%'.$query.'%');
} }
if(preg_match('/^[a-zA-Z0-9_,]+$/',$order)) if(!preg_match('/^[a-zA-Z0-9_,]+$/',$order))
{ {
$querymethod .= ' ORDER BY '.$order; $order = 'hol_local';
} }
$this->db->select($this->table,'DISTINCT hol_locale',$querymethod,__LINE__,__FILE__); $this->db->select($this->table,'DISTINCT hol_locale',$querymethod,__LINE__,__FILE__,false,$order);
while($this->db->next_record()) while($this->db->next_record())
{ {
$locale[] = $this->db->f('hol_locale'); $locale[] = $this->db->f('hol_locale');

View File

@ -92,7 +92,7 @@
'left_next_matchs' => $GLOBALS['egw']->nextmatchs->left('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total), 'left_next_matchs' => $GLOBALS['egw']->nextmatchs->left('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
'right_next_matchs' => $GLOBALS['egw']->nextmatchs->right('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total), 'right_next_matchs' => $GLOBALS['egw']->nextmatchs->right('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
'center' => '<td align="center">'.lang('Countries').'</td>', 'center' => '<td align="center">'.lang('Countries').'</td>',
'sort_name' => $GLOBALS['egw']->nextmatchs->show_sort_order($this->bo->sort,'locale',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Country')), 'sort_name' => $GLOBALS['egw']->nextmatchs->show_sort_order($this->bo->sort,'hol_locale',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Country')),
'header_edit' => lang('Edit'), 'header_edit' => lang('Edit'),
'header_delete' => lang('Delete'), 'header_delete' => lang('Delete'),
'header_extra' => lang('Submit to Repository'), 'header_extra' => lang('Submit to Repository'),