Commit d66e9b3c authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Automatische Korrektur von Yandex ignoriert

Wenn Yandex jetzt nichts für eine Phrasensuche findet und stattdessen eine Suche mit den Suchwörtern ohne Anführungszeichen durchführt, verwerfen wir alle Ergebnisse.
parent 8955234b
......@@ -23,6 +23,15 @@ class Yandex extends Searchengine
# let's check if the query got unquoted
# in that case we will ignore all results because that would mean
# a string search (query between "") was wished and no results for that foudn
$reask = $content->xpath("//yandexsearch/response/reask");
if(sizeof($reask) !== 0 && $reask[0]->{"rule"}->__toString()){
$results = $content->xpath("//yandexsearch/response/results/grouping/group");
foreach ($results as $result) {
$title = strip_tags($result->{"doc"}->{"title"}->asXML());
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