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

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

parent 76f813ab
No related branches found
No related tags found
2 merge requests!117Bugfix,!116Bugfix
...@@ -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