Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/87715
Change subject: Don't break $wgFileExtensions structure when removing 'mp4' ...................................................................... Don't break $wgFileExtensions structure when removing 'mp4' Bug: 55366 Change-Id: I961070c1330f2492adac67d0dbb4066ad88b9819 --- M TimedMediaHandler.hooks.php 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/15/87715/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 779221a..54919cb 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -18,10 +18,9 @@ // Remove mp4 if not enabled: if( $wgTmhEnableMp4Uploads === false ){ - foreach( $wgFileExtensions as $inx => $val ) { - if( $val == 'mp4' ){ - unset( $wgFileExtensions[$inx] ); - } + $index = array_search( 'mp4', $wgFileExtensions ); + if ( $index !== false ) { + array_splice( $wgFileExtensions, $index, 1 ); } } -- To view, visit https://gerrit.wikimedia.org/r/87715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I961070c1330f2492adac67d0dbb4066ad88b9819 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits