Make title validation case-insensitive

Created on 30 October 2020, over 4 years ago
Updated 17 July 2025, 2 days ago

Problem/Motivation

Node Title Validation is currently case-sensitive when it comes to comparing configured excluded words with new node titles.

I am using Node Title Validation to fight spam on a website, alongside with Akismet and other solutions, and making this check case-insensitive would make it more robust : spambots would not be able to create nodes titled "StrEaMing" when "streaming" is configured as a forbidden word. Right now, the only workaround is to configure all versions of this word containing capital letters (ie : STReaming, STREaminG ...), and of course this is tedious.

This also seems appropriate for other usecases IMHO, as if a word is forbidden in node titles, I think its capitalized versions should also be.

Steps to reproduce

  • Configure for example "streaming" as a forbidden word for a node type
  • Create a new node of this type containing "STREAMING"
  • The node creation is not blocked by the module.

Proposed resolution

The following patch forces lowercase on both $find and $input (respectively, the forbidden word list and the user input) in _node_title_validation_search_excludes_in_title() before performing the check, to compare lowercase versions of both.

This could also be exposed as an option, like a checkbox to enable / disable case-sensitiveness.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024