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

Merge branch 'Bugfix' into 'development'

Bugfix



See merge request !117
parents 075a3212 84daaabf
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -44,7 +44,7 @@ class MetaGerSearch extends Controller ...@@ -44,7 +44,7 @@ class MetaGerSearch extends Controller
# Zunächst den Spruch # Zunächst den Spruch
$spruecheFile = storage_path() . "/app/public/sprueche.txt"; $spruecheFile = storage_path() . "/app/public/sprueche.txt";
if( file_exists($spruecheFile) && $_GET['sprueche']) if( file_exists($spruecheFile) && $request->has('sprueche') )
{ {
$sprueche = file($spruecheFile); $sprueche = file($spruecheFile);
$spruch = $sprueche[array_rand($sprueche)]; $spruch = $sprueche[array_rand($sprueche)];
......
...@@ -81,6 +81,8 @@ class Result ...@@ -81,6 +81,8 @@ class Result
#die($tmpLi . "<br>" . $link . "<br>" . $tmpEingabe . "<br><br>"); #die($tmpLi . "<br>" . $link . "<br>" . $tmpEingabe . "<br><br>");
foreach(str_split($tmpEingabe) as $char) foreach(str_split($tmpEingabe) as $char)
{ {
if( !$char || !$tmpEingabe || strlen($tmpEingabe) === 0 || strlen($char) === 0 )
continue;
if(strpos(strtolower($tmpLink), strtolower($char)) >= 0) if(strpos(strtolower($tmpLink), strtolower($char)) >= 0)
{ {
$count++; $count++;
......
...@@ -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