Make WordPress Core

Ticket #3594: 3594.diff

File 3594.diff, 4.2 KB (added by mdawaffe, 18 years ago)
  • wp-includes/post-template.php

     
    368368                $src_file = $icon_dir . '/' . basename($src);
    369369        }
    370370
    371         if ( !isset($src) )
     371        if ( !isset($src) || !$src )
    372372                return false;
     373
    373374        return array($src, $src_file);
    374375}
    375376
  • wp-includes/script-loader.php

     
    3838                        $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' );
    3939                        $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' );
    4040                        $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' );
    41                         $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20061223' );
     41                        $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070116' );
    4242                }
    4343        }
    4444
  • wp-admin/upload-js.php

     
    5656                                this.currentImage.width = false;
    5757                                this.currentImage.height = false;
    5858                        }
    59                         this.currentImage.isImage = ( 0 == id ? '' : $('attachment-is-image-' + id).value );
     59                        this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value );
    6060                        this.currentImage.ID = id;
    6161                },
    6262
     
    7474                                h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
    7575                        }
    7676                        h += "<div id='file-title'>"
    77                         if ( !this.currentImage.isImage )
     77                        if ( 0 == this.currentImage.isImage )
    7878                                h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
    7979                        else
    8080                                h += "<h2>" + this.currentImage.title + "</h2>";
     
    8383                        h += "</span>";
    8484                        h += '</div>'
    8585                        h += "<div id='upload-file-view' class='alignleft'>";
    86                         if ( this.currentImage.isImage ) {
     86                        if ( 1 == this.currentImage.isImage ) {
    8787                                h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
    8888                                h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
    8989                                h += "</a>";
     
    152152                                h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
    153153                        }
    154154                        h += "<div id='file-title'>"
    155                         if ( !this.currentImage.isImage )
     155                        if ( 0 == this.currentImage.isImage )
    156156                                h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
    157157                        else
    158158                                h += "<h2>" + this.currentImage.title + "</h2>";
     
    161161                        h += "</span>";
    162162                        h += '</div>'
    163163                        h += "<div id='upload-file-view' class='alignleft'>";
    164                         if ( this.currentImage.isImage ) {
     164                        if ( 1 == this.currentImage.isImage ) {
    165165                                h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
    166166                                h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
    167167                                h += "</a>";
     
    230230                        displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
    231231                        if ( displayEl )
    232232                                display = displayEl.value;
    233                         else if ( this.currentImage.isImage )
     233                        else if ( 1 == this.currentImage.isImage )
    234234                                display = 'full';
    235235
    236236                        if ( 'none' != link )