[wp-trac] [WordPress Trac] #60347: wp_kses breaking text fragments links

WordPress Trac noreply at wordpress.org
Thu Mar 27 16:10:50 UTC 2025


#60347: wp_kses breaking text fragments links
-------------------------------------------------+-------------------------
 Reporter:  asafm7                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests changes-requested     |     Focuses:
  has-testing-info                               |
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 Replying to [comment:14 shanemuir]:
 > I think you are right in that these are not protocols and maybe would be
 better worked in a more specific function.

 Yes, that solution can solve the issue for now, but if new problems arise
 in the future, it's gonna be bread for today and hunger for tomorrow
 because it's completely out of context (and probably someone else will be
 writing on top of this aother function to handle new scenarios)

 I'm not knowledgeable of every other function existing, but issuing some
 searches, I can't seem to see any other better function to place this in
 the kses files. So personally, I would opt for a new function to parse
 this specifically (and no need to use the array)). Problem with this, is
 that the amount of wet code regarding the call of this function is brutal.
 https://github.com/WordPress/wordpress-
 develop/blob/baab2b8f2273319817edede1b3360f212cf42241/src/wp-
 includes/kses.php#L1415-L1509

 More specifically the entry point is here:
 https://github.com/WordPress/wordpress-
 develop/blob/baab2b8f2273319817edede1b3360f212cf42241/src/wp-
 includes/kses.php#L1446

 Again, this is not generally recommended because it's a lot of work for
 the reviewers, but still I would rather opt for a full refactor for all
 that wet code. It's not a straight and easy solution but get on the
 challenge.

 And now you have plenty of time because we are in 6.9-alpha 💪

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60347#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list