Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37955 closed enhancement (fixed)

Make it possible to whitelist URLs in check_comment()

Reported by: ocean90's profile ocean90 Owned by: rachelbaker's profile rachelbaker
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch commit
Focuses: Cc:


Use case: #meta1776

There is currently no way to exclude URLs for the number of external links check.

One option might be to pass $comment to the comment_max_links_url filter. This would make it possible to re-check the comment and reduce $num_links.

Attachments (1)

37955.diff (803 bytes) - added by rachelbaker 8 years ago.
Adds the $comment parameter to the comment_max_links_url filter

Download all attachments as: .zip

Change History (5)

8 years ago

Adds the $comment parameter to the comment_max_links_url filter

#1 @rachelbaker
8 years ago

  • Keywords has-patch commit added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.7

#2 @rachelbaker
8 years ago

In 37955.diff I added the $comment parameter to the comment_max_links filter. This allows the comment_content to be included in hooked functions.

@ocean90 This was the best option I could see to solve for your provided (and likely somewhat common) use-case.

#3 @rachelbaker
8 years ago

  • Owner set to rachelbaker
  • Status changed from new to accepted

#4 @ocean90
8 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 38748:

Comments: Pass $comment to the comment_max_links_url filter.

Props rachelbaker.
Fixes #37955.

Note: See TracTickets for help on using tickets.