mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
Fix for BUG 900342 - determine preloaded query string which includes wildcards
This commit is contained in:
parent
745a6c347b
commit
265b36c9eb
@ -516,11 +516,25 @@
|
||||
return $qarray;
|
||||
}
|
||||
|
||||
$first = $last = "*";
|
||||
if(strstr($query,"*"))
|
||||
{
|
||||
if(substr($query,-1) == "*")
|
||||
{
|
||||
$last = '';
|
||||
}
|
||||
if(substr($query,1) == "*")
|
||||
{
|
||||
$first = '';
|
||||
}
|
||||
}
|
||||
|
||||
if(@is_array($extra))
|
||||
{
|
||||
if($DEBUG) { echo '<br>Searching...'; }
|
||||
foreach($extra as $name => $value)
|
||||
{
|
||||
|
||||
$qarray[] = array($value => $query);
|
||||
}
|
||||
}
|
||||
@ -557,7 +571,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$oquery .= '(' . $x . '=*' . $y . '*)';
|
||||
$oquery .= '(' . $x . '=' . $first . $y . $last . ')';
|
||||
$hasor = True;
|
||||
}
|
||||
}
|
||||
@ -565,7 +579,7 @@
|
||||
elseif($value == $query)
|
||||
{
|
||||
/* searching */
|
||||
$oquery .= '(' . $name . '=*' . $value . '*)';
|
||||
$oquery .= '(' . $name . '=' . $first . $value . $last . ')';
|
||||
$hasor = True;
|
||||
}
|
||||
else
|
||||
@ -615,6 +629,7 @@
|
||||
echo '<br>Will search in "' . $GLOBALS['phpgw_info']['server']['ldap_contact_context'] . '"';
|
||||
}
|
||||
|
||||
// echo $fquery;
|
||||
return $fquery;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user