[wp-trac] [WordPress Trac] #19282: wp_get_attachment_link() does not allow HTML in link text

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 30 05:41:50 UTC 2012


#19282: wp_get_attachment_link() does not allow HTML in link text
----------------------------+------------------
 Reporter:  SergeyBiryukov  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.4
Component:  General         |     Version:  2.8
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------

Comment (by SergeyBiryukov):

 I don't see a reason to escape the text here. If someone calls
 `wp_get_attachment_link()` with `<script>` tags, they could as well insert
 them into the template file directly.

 That would be inconsistent with other `*_link()` functions which don't
 escape anchor text:

 * `the_feed_link()`
 * `post_comments_feed_link()`
 * `edit_term_link()`
 * `edit_post_link()`
 * `edit_comment_link()`
 * `edit_bookmark_link()`
 * `adjacent_post_link()`
 * `get_next_posts_link()`
 * `get_previous_posts_link()`
 * `get_next_comments_link()`
 * `get_previous_comments_link()`

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19282#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list