mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
attr(), _a(), _ea(), _xa() for shorthand attribute escaping. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11103 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2073,17 +2073,32 @@ function js_escape($text) {
|
||||
/**
|
||||
* Escaping for HTML attributes.
|
||||
*
|
||||
* @since 2.0.6
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
function attribute_escape( $text ) {
|
||||
function 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Escaping for HTML attributes.
|
||||
*
|
||||
* @since 2.0.6
|
||||
*
|
||||
* @deprecated 2.8.0
|
||||
* @see attr()
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
function attribute_escape( $text ) {
|
||||
return attr( $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape a HTML tag name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user