attr(), _a(), _ea(), _xa() for shorthand attribute escaping. see #9650
git-svn-id: http://svn.automattic.com/wordpress/trunk@11103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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