From 69918f4ae9415f2a5499a347d124a634040c93e2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 17 Mar 2018 06:54:47 +0000 Subject: [PATCH] Ignore obvious garbage results --- mod/dirfind.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mod/dirfind.php b/mod/dirfind.php index 52e7c2aa02..da3fafce29 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -149,10 +149,17 @@ function dirfind_content(App $a, $prefix = "") { continue; } + $urlparts = parse_url($result["nurl"]); + + // Ignore results that look strange. + // For historic reasons the gcontact table does contain some garbage. + if (!empty($urlparts['query']) || !empty($urlparts['fragment'])) { + continue; + } + $result = Contact::getDetailsByURL($result["nurl"], local_user()); if ($result["name"] == "") { - $urlparts = parse_url($result["nurl"]); $result["name"] = end(explode("/", $urlparts["path"])); }