Skip to content
Snippets Groups Projects
Commit 84daaabf authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Bug behoben, bei dem die Minisucher manchmal abgestürzt sind.

parent 79292ba1
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -30,28 +30,33 @@ class Minisucher extends Searchengine ...@@ -30,28 +30,33 @@ class Minisucher extends Searchengine
$counter = 0; $counter = 0;
foreach($results as $result) foreach($results as $result)
{ {
$counter++; try{
$result = simplexml_load_string($result->saveXML()); $counter++;
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); $result = simplexml_load_string($result->saveXML());
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$anzeigeLink = $link; $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
$descr = ""; $anzeigeLink = $link;
$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); $descr = "";
foreach($descriptions as $description) $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
foreach($descriptions as $description)
{
$descr .= $description->__toString();
}
$descr = strip_tags($descr);
$provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$link,
$descr,
$this->gefVon,
$counter
);
}catch(\ErrorException $e)
{ {
$descr .= $description->__toString(); continue;
} }
$descr = strip_tags($descr);
$provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$link,
$descr,
$this->gefVon,
$counter
);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment