[wp-trac] [WordPress Trac] #22668: Introduce esc_attr() reverted function

WordPress Trac noreply at wordpress.org
Sat Dec 1 01:49:10 UTC 2012


#22668: Introduce esc_attr() reverted function
-----------------------------+----------------------
 Reporter:  alexvorn2        |       Owner:
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Formatting       |     Version:
 Severity:  normal           |  Resolution:  invalid
 Keywords:  close            |
-----------------------------+----------------------

Comment (by alexvorn2):

 Replying to [comment:1 dd32]:
 > Sounds like you're after html_entity_decode()

 this function does not work for single quote.

 If a such function exists - esc_attr() than logically it should also exist
 a reverted function like capture_attr() or cap_attr() for such task.

 function esc_attr():

 {{{
 function esc_attr( $text ) {
         $safe_text = wp_check_invalid_utf8( $text );
         $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
         return apply_filters( 'attribute_escape', $safe_text, $text );
 }
 }}}

 function cap_attr():

 {{{
 function cap_attr( $text ) {
         $safe_text = wp_specialchars_decode( $text, ENT_QUOTES );
         return apply_filters( 'attribute_capture', $safe_text, $text );
 }
 }}}

 No?

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


More information about the wp-trac mailing list