From 42b34d078353cb4a9a4bace27b990f04ee4ea882 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 17 Aug 2023 15:09:56 +0300 Subject: [PATCH] fix settings procesing, remove unused variables --- src/crontab/crawler.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/crontab/crawler.php b/src/crontab/crawler.php index 1628913..395fbf5 100644 --- a/src/crontab/crawler.php +++ b/src/crontab/crawler.php @@ -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++; } } }