fix lint
Tests & Lint & Deploy to Railway / build (20.x, 8.2) (push) Successful in 3m11s Details
Tests & Lint & Deploy to Railway / deploy (8.1) (push) Failing after 1m42s Details

This commit is contained in:
aslan 2024-01-23 14:07:20 +03:00
parent b8063db38b
commit 42ac5057c4
1 changed files with 3 additions and 4 deletions

View File

@ -19,16 +19,15 @@ class PageScrapper
$strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/isU"; $strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/isU";
$arr = []; $arr = [];
$rez = preg_match_all($strForPregMatch, $page, $arr); $rez = preg_match_all($strForPregMatch, $page, $arr);
return $content = $arr[1][0].'</div>'; return $content = $arr[1][0] . '</div>';
} }
public function normalizeURLFile($content) public function normalizeURLFile($content)
{ {
$rez = preg_match_all('/href="(.*)"/isU',$content,$arr); $rez = preg_match_all('/href="(.*)"/isU', $content, $arr);
foreach ($arr[1] as $el) { foreach ($arr[1] as $el) {
if (strpos($el, 'http') !== 0) { if (strpos($el, 'http') !== 0) {
$content = str_replace($el,'https://mkgtu.ru'.$el,$content); $content = str_replace($el, 'https://mkgtu.ru' . $el, $content);
} }
} }
return $content; return $content;