fix settings procesing, remove unused variables

This commit is contained in:
ghost 2023-08-17 15:09:56 +03:00
parent b1bfd79b80
commit 42b34d0783

View File

@ -1007,28 +1007,28 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_HOST_PAGE_QUEUE_LIMIT, time() - CRAWL_
$value = trim($node->ownerDocument->saveHtml());
// Apply selector settings
foreach ($settings as $key => $value) {
foreach ($settings as $key => $setting) {
switch ($key) {
case 'strip_tags':
if (!isset($value->enabled)) {
if (!isset($setting->enabled)) {
continue 2;
}
if (false === $value->enabled) {
if (false === $setting->enabled) {
continue 2;
}
if (!isset($value->allowed_tags)) {
if (!isset($setting->allowed_tags)) {
continue 2;
}
$value = strip_tags($value, $value->allowed_tags);
$value = strip_tags($value, $setting->allowed_tags);
break;
}
@ -1047,8 +1047,6 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_HOST_PAGE_QUEUE_LIMIT, time() - CRAWL_
$value,
time()
);
$hostPageDomAddedTotal++;
}
}
}