WordPress.org

Make WordPress Core

Changeset 22872


Ignore:
Timestamp:
11/27/2012 04:17:53 PM (5 years ago)
Author:
ryan
Message:

Always send nocache_headers() for admin-ajax.php. This prevents iOS from caching ajax calls. http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results

Turn off multi selection uploads for mobile devices. Currently Plupload cannot upload multiple files in iOS Safari. Only the first file makes it to the queue.

Empty wp on unload to work around caching in iOS Safari.

Props azaozz, miqrogroove, nacin

fixes #22552

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r22768 r22872  
    3737
    3838send_nosniff_header();
     39nocache_headers();
    3940
    4041do_action( 'admin_init' );
  • trunk/wp-admin/includes/media.php

    r22867 r22872  
    15091509);
    15101510
     1511// Multi-file uploading doesn't currently work in iOS Safari,
     1512// single-file allows the built-in camera to be used as source for images
     1513if ( wp_is_mobile() )
     1514    $plupload_init['multi_selection'] = false;
     1515
    15111516$plupload_init = apply_filters( 'plupload_init', $plupload_init );
    15121517
  • trunk/wp-includes/js/media-models.js

    r22869 r22872  
    810810    });
    811811
     812    // Clean up. Prevents mobile browsers caching
     813    $(window).on('unload', function(){
     814        window.wp = null;
     815    });
     816
    812817}(jQuery));
  • trunk/wp-includes/media.php

    r22870 r22872  
    12551255        'urlstream_upload'    => true,
    12561256    );
     1257   
     1258    // Multi-file uploading doesn't currently work in iOS Safari,
     1259    // single-file allows the built-in camera to be used as source for images
     1260    if ( wp_is_mobile() )
     1261        $defaults['multi_selection'] = false;
    12571262
    12581263    $defaults = apply_filters( 'plupload_default_settings', $defaults );
Note: See TracChangeset for help on using the changeset viewer.