From b8de9e0b0374be714d1ae4d2c171ccb7b813478d Mon Sep 17 00:00:00 2001
From: Dominik Pfennig <dominik@suma-ev.de>
Date: Fri, 8 Jul 2016 08:55:02 +0200
Subject: [PATCH] =?UTF-8?q?Bug=20behoben,=20bei=20dem=20die=20Minisucher?=
 =?UTF-8?q?=20manchmal=20abgest=C3=BCrzt=20sind.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Models/parserSkripte/Minisucher.php | 45 ++++++++++++++-----------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/app/Models/parserSkripte/Minisucher.php b/app/Models/parserSkripte/Minisucher.php
index f7838b814..2b42f8dca 100644
--- a/app/Models/parserSkripte/Minisucher.php
+++ b/app/Models/parserSkripte/Minisucher.php
@@ -30,28 +30,33 @@ class Minisucher extends Searchengine
 		$counter = 0;
 		foreach($results as $result)
 		{
-			$counter++;
-			$result = simplexml_load_string($result->saveXML());
-			$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
-			$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
-			$anzeigeLink = $link;
-			$descr = "";
-			$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
-			foreach($descriptions as $description)
+			try{
+				$counter++;
+				$result = simplexml_load_string($result->saveXML());
+				$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
+				$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
+				$anzeigeLink = $link;
+				$descr = "";
+				$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
-					);
 		}
 		
 		
-- 
GitLab