Index: trunk/phase3/includes/Export.php |
— | — | @@ -759,8 +759,10 @@ |
760 | 760 | } |
761 | 761 | if ( $newname ) { |
762 | 762 | fclose( $this->handle ); |
763 | | - rename( $this->filename, $newname ); |
764 | | - if ( $open ) { |
| 763 | + if (! rename( $this->filename, $newname ) ) { |
| 764 | + throw new MWException( __METHOD__ . ": rename of file {$this->filename} to $newname failed\n" ); |
| 765 | + } |
| 766 | + elseif ( $open ) { |
765 | 767 | $this->handle = fopen( $this->filename, "wt" ); |
766 | 768 | } |
767 | 769 | } |
— | — | @@ -814,8 +816,10 @@ |
815 | 817 | if ( $newname ) { |
816 | 818 | fclose( $this->handle ); |
817 | 819 | proc_close( $this->procOpenResource ); |
818 | | - rename( $this->filename, $newname ); |
819 | | - if ( $open ) { |
| 820 | + if (! rename( $this->filename, $newname ) ) { |
| 821 | + throw new MWException( __METHOD__ . ": rename of file {$this->filename} to $newname failed\n" ); |
| 822 | + } |
| 823 | + elseif ( $open ) { |
820 | 824 | $command = $this->command; |
821 | 825 | $command .= " > " . wfEscapeShellArg( $this->filename ); |
822 | 826 | $this->startCommand( $command ); |
— | — | @@ -873,8 +877,10 @@ |
874 | 878 | if ( $newname ) { |
875 | 879 | fclose( $this->handle ); |
876 | 880 | proc_close( $this->procOpenResource ); |
877 | | - rename( $this->filename, $newname ); |
878 | | - if ( $open ) { |
| 881 | + if (! rename( $this->filename, $newname ) ) { |
| 882 | + throw new MWException( __METHOD__ . ": rename of file {$this->filename} to $newname failed\n" ); |
| 883 | + } |
| 884 | + elseif ( $open ) { |
879 | 885 | $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
880 | 886 | // Suppress annoying useless crap from p7zip |
881 | 887 | // Unfortunately this could suppress real error messages too |