Gilles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/196199

Change subject: Fix file type check in firedog transport
......................................................................

Fix file type check in firedog transport

Bug: T89011
Change-Id: I937adb485b514b88596f9d4c913c51220c4a5f17
---
M resources/mw.FirefoggTransport.js
1 file changed, 16 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/99/196199/1

diff --git a/resources/mw.FirefoggTransport.js 
b/resources/mw.FirefoggTransport.js
index fa62737..534b0c5 100644
--- a/resources/mw.FirefoggTransport.js
+++ b/resources/mw.FirefoggTransport.js
@@ -87,8 +87,16 @@
                if ( info.contentType.indexOf( 'image/' ) !== -1 ) {
                        return false;
                }
-               return ( ( !info.video || info.video.length === 0 ) && 
info.audio.length > 0 ) ||
-                               info.contentType.indexOf( 'audio/' ) !== -1;
+
+               if ( info.video && info.video.length > 0 ) {
+                       return false;
+               }
+
+               if ( info.audio && info.audio.length > 0 ) {
+                       return true;
+               }
+
+               return info.contentType.indexOf( 'audio/' ) !== -1;
        };
 
        FTP.isSourceVideo = function () {
@@ -97,8 +105,12 @@
                if ( info.contentType.indexOf( 'image/' ) !== -1 ) {
                        return false;
                }
-               return ( info.video && info.video.length > 0 && 
info.video[0].duration > 0.04 ) ||
-                       info.contentType.indexOf( 'video/' ) !== -1;
+
+               if ( info.video && info.video.length > 0 && 
info.video[0].duration > 0.04 ) {
+                       return true;
+               }
+
+               return info.contentType.indexOf( 'video/' ) !== -1;
        };
 
        FTP.isOggFormat = function () {

-- 
To view, visit https://gerrit.wikimedia.org/r/196199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I937adb485b514b88596f9d4c913c51220c4a5f17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Gilles <gdu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to