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

WordPress Trac noreply at wordpress.org
Sat Dec 1 03:04:21 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 dd32):

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

 esc_attr() is designed for escaping data to be used in HTML attributes,
 There are very rare cases where you should need to convert the data back,
 If you're saving something using esc_attr() and then later need to convert
 it back, you're probably doing it wrong, or using the wrong form of
 sanitization.

 > this function does not work for single quote.
 When used in it's compatibility mode (default) it doesn't, however, like
 most PHP functions, it has a range of configuration parameters.
 {{{
 echo html_entity_decode( '< > & " '', ENT_QUOTES ); //
 outputs < > & " '
 }}}

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


More information about the wp-trac mailing list