Make WordPress Core

Changeset 7124


Ignore:
Timestamp:
03/01/2008 08:41:18 PM (16 years ago)
Author:
ryan
Message:

Fix passed by reference errors. Props DD32. fixes #6056

File:
1 edited

Legend:

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

    r7105 r7124  
    3333        if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
    3434            $current = $_GET['tab'];
    35         else
    36             $current = array_shift(array_keys($tabs));
     35        else {
     36            $keys = array_keys($tabs);
     37            $current = array_shift($keys);
     38        }
    3739        foreach ( $tabs as $callback => $text ) {
    3840            $class = '';
     
    240242
    241243    if ( isset($_POST['send']) ) {
    242         $send_id = (int) array_shift(array_keys($_POST['send']));
     244        $keys = array_keys($_POST['send']);
     245        $send_id = (int) array_shift($keys);
    243246        $attachment = $_POST['attachments'][$send_id];
    244247        $html = apply_filters('media_send_to_editor', get_the_attachment_link($send_id, 0, array(125,125), !empty($attachment['post_content'])), $send_id, $attachment);
     
    630633
    631634    if ( isset($post_mime_types) ) {
    632         $type = array_shift(array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)));
     635        $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
     636        $type = array_shift($keys);
    633637        $type = "<input type='hidden' id='type-of-$attachment_id' value='$type' />";
    634638    }
Note: See TracChangeset for help on using the changeset viewer.