R53376 - /trunk/etemplate/inc/class.so_sql.inc.php

Author: ralfbecker
New Revision: 53376

URL: http://svn.stylite.de/viewvc/egroupware?rev=53376&view=rev
Log:

  • Admin: fix SQL error when searching in access rights popup (probably other places too)

Modified:
trunk/etemplate/inc/class.so_sql.inc.php

Modified: trunk/etemplate/inc/class.so_sql.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.so_sql.inc.php?rev=53376&r1=53375&r2=53376&view=diff

— trunk/etemplate/inc/class.so_sql.inc.php (original)
+++ trunk/etemplate/inc/class.so_sql.inc.php Thu Aug 13 14:55:01 2015
@@ -1230,10 +1230,6 @@
{
$search_cols = $this->get_default_search_columns();
}

  •   if(!$search_cols)
    
  •   {
    
  •   	return array();
    
  •   }
      // Concat all fields to be searched together, so the conditions operate across the whole record
      foreach($search_cols as $col)
      {
    

@@ -1249,15 +1245,15 @@
$numeric_columns[] = $col;
continue;
}

  •   	if ($this->db->Type == 'mysql' && $table_def['fd'][$col_name]['type'] === 'ascii' && !preg_match('/[\x80-\xFF]/', $_pattern))
    
  •   	if ($this->db->Type == 'mysql' && $table_def['fd'][$col_name]['type'] === 'ascii' && preg_match('/[\x80-\xFF]/', $_pattern))
      	{
      		continue;	// will only give sql error
      	}
      	$columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],"COALESCE($col,'')");
      }
    
  •   if($columns)
    
  •   {
    
  •   	$columns = call_user_func_array(array($GLOBALS['egw']->db,'concat'),$columns);
    
  •   if(!$search_cols)
    
  •   {
    
  •   	return array();
      }
    
      // Break the search string into tokens
    

@@ -1317,7 +1313,8 @@
$op = ‘OR’;
break;
}

  •   	$token_filter = " $columns " . $this->db->capabilities['case_insensitive_like'] . ' ' .
    
  •   	$token_filter = ' '.call_user_func_array(array($GLOBALS['egw']->db,'concat'),$columns).' '.
    
  •   		$this->db->capabilities['case_insensitive_like'] . ' ' .
      		$GLOBALS['egw']->db->quote($wildcard.str_replace(array('%','_','*','?'),array('\\%','\\_','%','_'),$token).$wildcard);
    
      	// Compare numeric token as equality for numeric columns
    


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs