Closed (outdated)
Project:
Spam
Version:
6.x-1.x-dev
Component:
URL Filter
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2012 at 09:31 UTC
Updated:
12 Mar 2020 at 11:55 UTC
Jump to comment: Most recent
Comments
Comment #1
AlexisWilke commentedYou have to come up with a regular expression that can catch those.
Assuming that the users cannot directly edit the HTML code, that's relatively easy:
<a[^>]+href=[^>]+>This will detect an anchor with an href. However, browsers will generally accept a > inside an attribute written with quotes. Yet, if you use a WYSIWYG editor, I believe it will be difficult for a spammer to introduce such in the HTML code.
Edit: made the < and > show up as expected inside the code block.
Comment #2
nikhiljain commentedThanks Alexis. I am using a WYSIWYG editor. Can you tell me how exactly I can integrate this with the URL Filter?
Comment #3
AlexisWilke commentedPosted by Jeremy on April 18, 2012 at 1:31pm
There are many regexp formulas available online that can help you write your custom filters:
For example:
http://blog.stevenlevithan.com/archives/validate-phone-number
(It's not clear to me if your issue is the writing of valid regular expressions, or something else.)
From #1537114: Cannot block phone numbers
Comment #4
nikhiljain commentedActually it's a feature request. I wanted this functionality to be added in the current URL-Filter only as it is Anchor URL we are talking about.
Comment #5
AlexisWilke commentedSorry, I thought you said "custom" filter... my bad 8-)
Comment #6
avpadernoI am closing this issue, since it's for a Drupal version no longer supported.