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:
ryan
2009-04-27 21:58:04 +00:00
parent 8cd2e92b69
commit 2249c69021
3 changed files with 55 additions and 6 deletions

View File

@@ -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.
*