Make WordPress Core

Changeset 28747


Ignore:
Timestamp:
06/11/2014 09:04:56 PM (10 years ago)
Author:
wonderboymusic
Message:

Don't use variable variables in touch_time().
See #27881.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r28730 r28747  
    757757
    758758    echo "\n\n";
    759     foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) {
    760         echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n";
     759    $map = array(
     760        'mm' => array( $mm, $cur_mm ),
     761        'jj' => array( $jj, $cur_jj ),
     762        'aa' => array( $aa, $cur_aa ),
     763        'hh' => array( $hh, $cur_hh ),
     764        'mn' => array( $mn, $cur_mn ),
     765    );
     766    foreach ( $map as $timeunit => $value ) {
     767        list( $unit, $curr ) = $value;
     768
     769        echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
    761770        $cur_timeunit = 'cur_' . $timeunit;
    762         echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n";
     771        echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
    763772    }
    764773?>
Note: See TracChangeset for help on using the changeset viewer.