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:
Ryan Boren
2009-04-27 21:58:04 +00:00
parent b05307b90c
commit 036a7656f9
3 changed files with 55 additions and 6 deletions
+17 -2
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.
*