Skip to content

fix: disallow URLs in item titles#3116

Open
radsclaw wants to merge 1 commit into
stackernews:masterfrom
radsclaw:fix/disallow-uri-schemes-in-titles
Open

fix: disallow URLs in item titles#3116
radsclaw wants to merge 1 commit into
stackernews:masterfrom
radsclaw:fix/disallow-uri-schemes-in-titles

Conversation

@radsclaw

Copy link
Copy Markdown

Description

Fixes #117.

Post titles now reject URL protocol strings like https://example.com or ftp://example.com through the shared titleValidator. Bare domains such as Crypto.com stadium hosts big game remain allowed, matching the issue's example.

The shared validator covers discussion, link, poll, bounty, and job titles.

QA

  • npm test -- --runTestsByPath lib/validate.test.js --runInBand
  • npx standard lib/validate.js lib/validate.test.js
  • git diff --check

Notes

I intentionally limited detection to protocol URLs containing :// so ordinary title text and non-URL URI-like strings such as email/lightning address text are not rejected by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow URIs in the post Title

1 participant