From ba8e36f94cc6851f5f103579dd2dc798913d78b9 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 13 May 2014 04:47:11 +0000 Subject: [PATCH] Eliminate use of `extract()` in `the_title_attribute()`. See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28383 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index c4a84f790c..de21ddde9c 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -69,22 +69,23 @@ function the_title($before = '', $after = '', $echo = true) { * @return string|null Null on failure or display. String when echo is false. */ function the_title_attribute( $args = '' ) { - $defaults = array('before' => '', 'after' => '', 'echo' => true, 'post' => get_post() ); - $r = wp_parse_args($args, $defaults); - extract( $r, EXTR_SKIP ); + $defaults = array( 'before' => '', 'after' => '', 'echo' => true, 'post' => get_post() ); + $r = wp_parse_args( $args, $defaults ); - $title = get_the_title( $post ); + $title = get_the_title( $r['post'] ); - if ( strlen($title) == 0 ) + if ( strlen( $title ) == 0 ) { return; + } - $title = $before . $title . $after; - $title = esc_attr(strip_tags($title)); + $title = $r['before'] . $title . $r['after']; + $title = esc_attr( strip_tags( $title ) ); - if ( $echo ) + if ( $r['echo'] ) { echo $title; - else + } else { return $title; + } } /**