Don't blindly overwrite $options in importImages.php
authorReedy <reedy@wikimedia.org>
Fri, 18 Oct 2013 17:33:13 +0000 (18:33 +0100)
committerReedy <reedy@wikimedia.org>
Fri, 18 Oct 2013 17:35:12 +0000 (18:35 +0100)
Bug: 55883
Change-Id: I695e080000f6abec3ded966f12af3e25c585c3ba

maintenance/importImages.php

index cbbcf0f..f6f50f8 100644 (file)
@@ -230,14 +230,14 @@ if ( $count > 0 ) {
                } else {
                        $props = FSFile::getPropsFromPath( $file );
                        $flags = 0;
-                       $options = array();
+                       $publishOptions = array();
                        $handler = MediaHandler::getHandler( $props['mime'] );
                        if ( $handler ) {
-                               $options['headers'] = $handler->getStreamHeaders( $props['metadata'] );
+                               $publishOptions['headers'] = $handler->getStreamHeaders( $props['metadata'] );
                        } else {
-                               $options['headers'] = array();
+                               $publishOptions['headers'] = array();
                        }
-                       $archive = $image->publish( $file, $flags, $options );
+                       $archive = $image->publish( $file, $flags, $publishOptions );
                        if ( !$archive->isGood() ) {
                                echo "failed. (" .
                                        $archive->getWikiText() .