Commit 718eac42 by san58

наладил работу фильтров

1 parent c2737f34
......@@ -31,20 +31,19 @@ class Collection extends Component
{
$fiter_check = true;
foreach($filtes_bd as $filter)
{
$find = preg_match($filter['pattern'], $host);
if ($host === '002cc20.icu')
echo ' > i:'.$filter['include'].' result:'.$find.' if1:'.(($find === 1 && $filter['include']===Filter::INCLUDE_OFF)?1:0).' if2:'.(($find === 0 && $filter['include']===Filter::INCLUDE_ON)?1:0)."\n";
if (
($find === 1 && $filter['include']===Filter::INCLUDE_OFF) ||
($find === 0 && $filter['include']===Filter::INCLUDE_ON)
)
{
$fiter_check = false;
break;
}
unset($find);
}
if ($fiter_check === true)
{
$find = preg_match($filter['pattern'], $host);
if (
($find === 1 && (int)$filter['include']===Filter::INCLUDE_OFF) ||
($find === 0 && (int)$filter['include']===Filter::INCLUDE_ON)
)
{
$fiter_check = false;
break;
}
unset($find);
}
unset($filter);
if ($fiter_check===true)
$out = (string)$host;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!