Commit e8c27df4 authored by Karl's avatar Karl
Browse files

Yandex zur sicherheit bereits absturzsicher gemacht

parent ae633171
...@@ -59,24 +59,24 @@ class Yandex extends Searchengine ...@@ -59,24 +59,24 @@ class Yandex extends Searchengine
# Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt: # Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt:
try { try {
$content = simplexml_load_string($result); $content = simplexml_load_string($result);
if (!$content) {
return;
}
$resultCount = intval($content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]')[0]->__toString());
$pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0];
$pageLast = intval($pageLast["last"]->__toString());
if (count($this->results) <= 0 || $pageLast >= $resultCount) {
return;
}
$next = new Yandex(simplexml_load_string($this->engine), $metager);
$next->getString .= "&page=" . ($metager->getPage() + 1);
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next;
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error("Results from $this->name are not a valid json string"); Log::error("Results from $this->name are not a valid json string");
return; return;
} }
if (!$content) {
return;
}
$resultCount = intval($content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]')[0]->__toString());
$pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0];
$pageLast = intval($pageLast["last"]->__toString());
if (count($this->results) <= 0 || $pageLast >= $resultCount) {
return;
}
$next = new Yandex(simplexml_load_string($this->engine), $metager);
$next->getString .= "&page=" . ($metager->getPage() + 1);
$next->hash = md5($next->host . $next->getString . $next->port . $next->name);
$this->next = $next;
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment