From 3b757232d0eaabdd690a1a30ba844f3c4c0ca723 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 29 Sep 2014 00:13:47 +0000 Subject: [PATCH] Media: disable multi-file uploading in iOS 7.x Safari as it prevents uploading of videos. Fixes #29602 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@29776 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/media.php | 6 ++++-- src/wp-includes/media.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 3cde141024..0eeeaea6f8 100644 --- a/src/wp-admin/includes/media.php +++ b/src/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/src/wp-includes/media.php b/src/wp-includes/media.php index 7a39418f4a..f4492fc320 100644 --- a/src/wp-includes/media.php +++ b/src/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; }