auto-claude: subtask-3-4 - Run all tests and verify they pass

Fixed bug in social media exclusion logic that was too aggressive.
The substring check `any(ex in match.lower() for ex in excludes)`
was incorrectly excluding valid usernames containing exclusion
strings (e.g., 'testcompany' was excluded because it contained 'p').

Changed to exact match only to properly handle Instagram post URLs
(`instagram.com/p/...`) without false positives on valid usernames.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-01-08 20:41:54 +01:00
parent 9cd5066afe
commit 3d69d53550

View File

@ -408,9 +408,9 @@ class WebsiteAuditor:
if matches: if matches:
# Get first valid match, excluding common false positives # Get first valid match, excluding common false positives
for match in matches: for match in matches:
# Check against exclusion list # Check against exclusion list (exact match only to avoid false positives)
excludes = SOCIAL_MEDIA_EXCLUDE.get(platform, []) excludes = SOCIAL_MEDIA_EXCLUDE.get(platform, [])
if match.lower() not in excludes and not any(ex in match.lower() for ex in excludes): if match.lower() not in excludes:
# Construct full URL # Construct full URL
if platform == 'facebook': if platform == 'facebook':
url = f'https://facebook.com/{match}' url = f'https://facebook.com/{match}'