1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Provide raw search query to custom method.

Issue: #4009 Support banlist filtering using wildcards.
This commit is contained in:
Cameron
2019-11-05 10:27:21 -08:00
parent 7f07f019c3
commit 281db68aa2
2 changed files with 4 additions and 3 deletions

View File

@@ -153,9 +153,10 @@ class banlist_ui extends e_admin_ui
"banlist_ip = '".$srch."'" "banlist_ip = '".$srch."'"
); );
if($ip6 = e107::getIPHandler()->ipEncode($srch)) if($ip6 = e107::getIPHandler()->ipEncode($srch,true))
{ {
$ret[] = "banlist_ip = '".$ip6."'"; $ip = str_replace('x', '', $ip6);
$ret[] = "banlist_ip LIKE '%".$ip."%'";
} }
return implode(" OR ",$ret); return implode(" OR ",$ret);

View File

@@ -4228,7 +4228,7 @@ class e_admin_controller_ui extends e_admin_controller
{ {
// Search for customer filter handler. // Search for customer filter handler.
$cutomerFilterMethod = 'handle'.$this->getRequest()->getActionName().$this->getRequest()->camelize($key).'Filter'; $cutomerFilterMethod = 'handle'.$this->getRequest()->getActionName().$this->getRequest()->camelize($key).'Filter';
$args = array($searchQuery); $args = array($tp->toDB($request->getQuery('searchquery', '')));
e107::getMessage()->addDebug("Searching for custom filter method: ".$className.'::'.$cutomerFilterMethod."(".implode(', ', $args).")"); e107::getMessage()->addDebug("Searching for custom filter method: ".$className.'::'.$cutomerFilterMethod."(".implode(', ', $args).")");
if(method_exists($this, $cutomerFilterMethod)) // callback handling if(method_exists($this, $cutomerFilterMethod)) // callback handling