Fix for BUG 900342 - determine preloaded query string which includes wildcards

This commit is contained in:
Miles Lott 2004-02-20 16:47:06 +00:00
parent 745a6c347b
commit 265b36c9eb

View File

@ -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;
}