http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88189

Revision: 88189
Author:   ialex
Date:     2011-05-15 14:48:15 +0000 (Sun, 15 May 2011)
Log Message:
-----------
Removed usage of error suppression operator in Special:LockDB and 
Special:UnlockDB

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialLockdb.php
    trunk/phase3/includes/specials/SpecialUnlockdb.php

Modified: trunk/phase3/includes/specials/SpecialLockdb.php
===================================================================
--- trunk/phase3/includes/specials/SpecialLockdb.php    2011-05-15 14:46:13 UTC 
(rev 88188)
+++ trunk/phase3/includes/specials/SpecialLockdb.php    2011-05-15 14:48:15 UTC 
(rev 88189)
@@ -109,8 +109,11 @@
                        $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()
                        # to fail at this point is insufficient permission to 
write to the file...good old

Modified: trunk/phase3/includes/specials/SpecialUnlockdb.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUnlockdb.php  2011-05-15 14:46:13 UTC 
(rev 88188)
+++ trunk/phase3/includes/specials/SpecialUnlockdb.php  2011-05-15 14:48:15 UTC 
(rev 88189)
@@ -104,7 +104,12 @@
                        $this->showForm( wfMsg( 'locknoconfirm' ) );
                        return;
                }
-               if ( @!unlink( $wgReadOnlyFile ) ) {
+
+               wfSuppressWarnings();
+               $res = unlink( $wgReadOnlyFile );
+               wfRestoreWarnings();
+
+               if ( !$res ) {
                        $wgOut->showFileDeleteError( $wgReadOnlyFile );
                        return;
                }


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to