Removed usage of error suppression operator in Special:LockDB and Special:UnlockDB
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 15 May 2011 14:48:15 +0000 (14:48 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 15 May 2011 14:48:15 +0000 (14:48 +0000)
includes/specials/SpecialLockdb.php
includes/specials/SpecialUnlockdb.php

index aad3cea..f8ab57b 100644 (file)
@@ -109,7 +109,10 @@ class SpecialLockdb extends SpecialPage {
                        $this->showForm( wfMsg( 'locknoconfirm' ) );
                        return;
                }
-               $fp = @fopen( $wgReadOnlyFile, 'w' );
+
+               wfSuppressWarnings();
+               $fp = fopen( $wgReadOnlyFile, 'w' );
+               wfRestoreWarnings();
 
                if ( false === $fp ) {
                        # This used to show a file not found error, but the likeliest reason for fopen()
index c71b554..88cd50e 100644 (file)
@@ -104,7 +104,12 @@ class SpecialUnlockdb extends SpecialPage {
                        $this->showForm( wfMsg( 'locknoconfirm' ) );
                        return;
                }
-               if ( @!unlink( $wgReadOnlyFile ) ) {
+
+               wfSuppressWarnings();
+               $res = unlink( $wgReadOnlyFile );
+               wfRestoreWarnings();
+
+               if ( !$res ) {
                        $wgOut->showFileDeleteError( $wgReadOnlyFile );
                        return;
                }