Assignment in loop conditions suck
[lhc/web/wiklou.git] / maintenance / 7zip.inc
index 6acd43b..833e76c 100644 (file)
@@ -1,4 +1,11 @@
 <?php
+/**
+ * 7z stream wrapper
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
 /**
  * Stream wrapper around 7za filter program.
  * Required since we can't pass an open file resource to XMLReader->open()
@@ -28,7 +35,7 @@ class SevenZipStream {
                        // Suppress the stupid messages on stderr
                        $command .= ' 2>/dev/null';
                }
-               $this->stream = popen( $command, $mode );
+               $this->stream = popen( $command, $mode[0] ); // popen() doesn't like two-letter modes
                return ( $this->stream !== false );
        }
        
@@ -66,4 +73,4 @@ class SevenZipStream {
                return fseek( $this->stream, $offset, $whence );
        }
 }
-stream_wrapper_register( 'mediawiki.compress.7z', 'SevenZipStream' );
\ No newline at end of file
+stream_wrapper_register( 'mediawiki.compress.7z', 'SevenZipStream' );