WordPress.org

Make WordPress Core

Ticket #3261: 3261.diff

File 3261.diff, 3.3 KB (added by mdawaffe, 12 years ago)
  • wp-admin/admin-functions.php

     
    122122                return;
    123123
    124124        $i = 0;
    125         $search = "# id=(\"|')p(\d+)\\1#i";
     125        $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i";
    126126        foreach ( $anchor_matches[0] as $anchor ) {
    127127                if ( 0 == preg_match($search, $anchor, $id_matches) )
    128128                        continue;
    129129
    130                 $id = $id_matches[2];
     130                $id = $id_matches[3];
    131131
    132132                // While we have the attachment ID, let's adopt any orphans.
    133133                $attachment = & get_post($id, ARRAY_A);
     
    20072007<?php if ( $icon ) : ?>
    20082008        <tr>
    20092009                <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th>
    2010                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td>
     2010                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>"><?php echo $icon ?></a></textarea></td>
    20112011        </tr>
    20122012        <tr>
    20132013                <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th>
    2014                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td>
     2014                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td>
    20152015        </tr>
    20162016<?php else : ?>
    20172017        <tr>
     
    20202020        </tr>
    20212021        <tr>
    20222022                <th scope="row"><?php _e('Link to page') ?></th>
    2023                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
     2023                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
    20242024        </tr>
    20252025<?php endif; ?>
    20262026</table>
     
    21202120        return $image;
    21212121}
    21222122
    2123 ?>
    2124  No newline at end of file
     2123?>
  • wp-admin/upload-js.php

     
    221221                                display = 'full';
    222222
    223223                        if ( 'none' != link )
    224                                 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment" ) ) + "' title='" + this.currentImage.title + "'>";
     224                                h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID + "'" ) ) + "' title='" + this.currentImage.title + "'>";
    225225                        if ( display )
    226226                                h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />";
    227227                        else