From e0a089d9d8af1f63eac6d115491ff8e4cc526670 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 11 Jun 2014 21:04:56 +0000 Subject: [PATCH] Don't use variable variables in `touch_time()`. See #27881. git-svn-id: https://develop.svn.wordpress.org/trunk@28747 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 9bf5b291a9..95a3bf950d 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -756,10 +756,19 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { if ( $multi ) return; echo "\n\n"; - foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) { - echo '' . "\n"; + $map = array( + 'mm' => array( $mm, $cur_mm ), + 'jj' => array( $jj, $cur_jj ), + 'aa' => array( $aa, $cur_aa ), + 'hh' => array( $hh, $cur_hh ), + 'mn' => array( $mn, $cur_mn ), + ); + foreach ( $map as $timeunit => $value ) { + list( $unit, $curr ) = $value; + + echo '' . "\n"; $cur_timeunit = 'cur_' . $timeunit; - echo '' . "\n"; + echo '' . "\n"; } ?>