r88189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88188‎ | r88189 | r88190 >
Date:14:48, 15 May 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed usage of error suppression operator in Special:LockDB and Special:UnlockDB
Modified paths:
  • /trunk/phase3/includes/specials/SpecialLockdb.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnlockdb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialLockdb.php
@@ -109,8 +109,11 @@
110110 $this->showForm( wfMsg( 'locknoconfirm' ) );
111111 return;
112112 }
113 - $fp = @fopen( $wgReadOnlyFile, 'w' );
114113
 114+ wfSuppressWarnings();
 115+ $fp = fopen( $wgReadOnlyFile, 'w' );
 116+ wfRestoreWarnings();
 117+
115118 if ( false === $fp ) {
116119 # This used to show a file not found error, but the likeliest reason for fopen()
117120 # to fail at this point is insufficient permission to write to the file...good old
Index: trunk/phase3/includes/specials/SpecialUnlockdb.php
@@ -104,7 +104,12 @@
105105 $this->showForm( wfMsg( 'locknoconfirm' ) );
106106 return;
107107 }
108 - if ( @!unlink( $wgReadOnlyFile ) ) {
 108+
 109+ wfSuppressWarnings();
 110+ $res = unlink( $wgReadOnlyFile );
 111+ wfRestoreWarnings();
 112+
 113+ if ( !$res ) {
109114 $wgOut->showFileDeleteError( $wgReadOnlyFile );
110115 return;
111116 }

Status & tagging log