ソースを参照

[fix] yahoo engines: parse_url doesn't throw an exception with not tracking URL

Dalf 10 年 前
コミット
a4ffeddce1
共有1 個のファイルを変更した5 個の追加3 個の削除を含む
  1. 5
    3
      searx/engines/yahoo.py

+ 5
- 3
searx/engines/yahoo.py ファイルの表示

@@ -40,9 +40,11 @@ def parse_url(url_string):
40 40
         if endpos > -1:
41 41
             endpositions.append(endpos)
42 42
 
43
-    end = min(endpositions)
44
-
45
-    return unquote(url_string[start:end])
43
+    if start==0 or len(endpositions) == 0:
44
+        return url_string        
45
+    else:
46
+        end = min(endpositions)
47
+        return unquote(url_string[start:end])
46 48
 
47 49
 
48 50
 # do search-request