Ticket #8627 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 3 years ago

Emoticons count as links in comments

Reported by: mtdewvirus Owned by: tott
Priority: normal Milestone: 2.7.1
Component: Comments Version: 2.7
Severity: normal Keywords: comment moderation link emoticon, has-patch, needs-testing
Cc:

Description

If "Convert emoticons like :-) and :-P to graphics on display" is enabled on the blog r9782 doesn't work as intended.

Each emoticon gets counted as a link in the comment (because the img has been inserted) and many comments are held in moderation that shouldn't be.

Change History

  • Owner changed from anonymous to tott
  • Keywords comment moderation link emoticon added; comment,link,emoticon removed
  • Component changed from General to Comments

Two workarounds for right now: 1-to increase the number of links a comment can have (wp-admin/options-discussion.php)

2-to deactivte the converting of emoticons like :-) and :-P to graphics(/wp-admin/options-writing.php)

Fix: Change the regular expression to this:

|(href\t*?=\t*?['\"]?)(https?:)?//|i

Eliminate that center question mark. If we're applying the comment_text filter first, then any unlinked http uris will have been autolinked already, meaning that the href= will exist around them. Making it not necessary for it to be optional.

This will also eliminate the false positive on an img src="http:whatever"

See also #7268

comment:6   tott3 years ago

  • Keywords emoticon, has-patch, needs-testing added; emoticon removed

added a revised version of the original patch to #7821 and tested against the current trunk. none of the issues appears.

comment:7   ryan3 years ago

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

(In [10453]) Don't count emoticons toward link total. Props tott. fixes #8627 #7821 for trunk

comment:8   ryan3 years ago

(In [10454]) Don't count emoticons toward link total. Props tott. fixes #8627 #7821 for 2.7

Note: See TracTickets for help on using tickets.