From 7a55ab916438c4c54f33a10595806430d81628af Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 29 Sep 2014 00:14:18 +0000 Subject: [PATCH] Media: disable multi-file uploading in iOS 7.x Safari as it prevents uploading of videos. Fixes #29602 for trunk. Built from https://develop.svn.wordpress.org/trunk@29776 git-svn-id: http://core.svn.wordpress.org/trunk@29548 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 6 ++++-- wp-includes/media.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 3cde141024..0eeeaea6f8 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1796,9 +1796,11 @@ $plupload_init = array( 'multipart_params' => $post_params, ); -// Currently only iOS Safari supports multiple files uploading but has a bug that prevents uploading of videos +// Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos // when enabled. See #29602. -if ( wp_is_mobile() ) { +if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false && + strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) { + $plupload_init['multi_selection'] = false; } diff --git a/wp-includes/media.php b/wp-includes/media.php index 7a39418f4a..f4492fc320 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2536,9 +2536,11 @@ function wp_plupload_default_settings() { ), ); - // Currently only iOS Safari supports multiple files uploading but has a bug that prevents uploading of videos + // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos // when enabled. See #29602. - if ( wp_is_mobile() ) { + if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false && + strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) { + $defaults['multi_selection'] = false; }