diff --git a/Plugin/unraid/include/ai_web.php b/Plugin/unraid/include/ai_web.php index 52b357c..e0f7fa3 100644 --- a/Plugin/unraid/include/ai_web.php +++ b/Plugin/unraid/include/ai_web.php @@ -188,7 +188,10 @@ function vv_ai_web_degoog(string $q): ?array { $rows = []; foreach ($d['results'] ?? [] as $r) { $url = (string)($r['url'] ?? ''); - if (preg_match('#^https?://(?:[a-z0-9-]+\.)*reddit\.com/r/[^/?#]+/?$#i', $url)) continue; + // Delimited with ~, not #. The character class has to exclude a literal # (a fragment), + // and with # as the delimiter PCRE ends the pattern there and the match silently never + // fires — which is exactly what happened, and it looked like the filter doing nothing. + if (preg_match('~^https?://(?:[a-z0-9-]+\.)*reddit\.com/r/[^/?#]+/?$~i', $url)) continue; $rows[] = ['title' => $r['title'] ?? '', 'url' => $url, 'snippet' => ($r['snippet'] ?? '') !== '' ? $r['snippet'] : ($r['content'] ?? '')];