WordPress.org

Make WordPress Core

Ticket #6243: degrade-swfupload-when-lighty.diff

File degrade-swfupload-when-lighty.diff, 2.8 KB (added by nbachiyski, 6 years ago)
  • wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js

     
    3636        SWFUpload.gracefulDegradation.swfUploadLoaded = function () { 
    3737                var swfupload_container_id, swfupload_container, degraded_container_id, degraded_container, user_swfUploadLoaded_handler; 
    3838                try { 
     39                        if (uploadDegradeOptions.is_lighttpd) throw "Lighttpd isn't supported!"; 
    3940                        swfupload_element_id = this.getSetting("swfupload_element_id"); 
    4041                        degraded_element_id = this.getSetting("degraded_element_id"); 
    4142                         
  • wp-includes/js/swfupload/handlers.js

     
    1 function uploadLoaded() { 
    2         jQuery("#html-upload-ui").remove(); 
    3         jQuery("#flash-upload-ui").show(); 
    4 } 
    5  
    61function fileDialogStart() { 
    72        jQuery("#media-upload-error").empty(); 
    83} 
  • wp-includes/script-loader.php

     
    8383                $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1'); 
    8484                $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2'); 
    8585                $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 
     86                $this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( 
     87                        'is_lighttpd' => isset($_SERVER['SERVER_SOFTWARE']) && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd'), 
     88                ) ); 
    8689                $this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); 
    8790                $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080301'); 
    8891                // these error messages came from the sample swfupload js, they might need changing. 
  • wp-admin/includes/media.php

     
    794794                        file_size_limit : "<?php echo wp_max_upload_size(); ?>b", 
    795795                        swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available 
    796796                        degraded_element_id : "html-upload-ui",   // when swfupload is unavailable 
    797                         swfupload_loaded_handler : uploadLoaded, 
    798797                        file_dialog_start_handler : fileDialogStart, 
    799798                        file_queued_handler : fileQueued, 
    800799                        upload_start_handler : uploadStart,