Removed some error suppression operators
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 8 Jul 2011 18:17:02 +0000 (18:17 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 8 Jul 2011 18:17:02 +0000 (18:17 +0000)
includes/Revision.php
includes/StreamFile.php
includes/User.php
includes/specials/SpecialWantedpages.php

index 93e6a05..6053700 100644 (file)
@@ -754,8 +754,8 @@ class Revision {
                # Use external methods for external objects, text in table is URL-only then
                if ( in_array( 'external', $flags ) ) {
                        $url = $text;
-                       @list(/* $proto */, $path ) = explode( '://', $url, 2 );
-                       if( $path == '' ) {
+                       $parts = explode( '://', $url, 2 );
+                       if( count( $parts ) == 1 || $parts[1] == '' ) {
                                wfProfileOut( __METHOD__ );
                                return false;
                        }
index f2f0566..d08cfec 100644 (file)
@@ -10,7 +10,9 @@
  * @param $headers array
  */
 function wfStreamFile( $fname, $headers = array() ) {
-       $stat = @stat( $fname );
+       wfSuppressWarnings();
+       $stat = stat( $fname );
+       wfRestoreWarnings();
        if ( !$stat ) {
                header( 'HTTP/1.0 404 Not Found' );
                header( 'Cache-Control: no-cache' );
index 839269d..b0dcc00 100644 (file)
@@ -1477,7 +1477,9 @@ class User {
                                if( $count > $max ) {
                                        wfDebug( __METHOD__ . ": tripped! $key at $count $summary\n" );
                                        if( $wgRateLimitLog ) {
-                                               @file_put_contents( $wgRateLimitLog, wfTimestamp( TS_MW ) . ' ' . wfWikiID() . ': ' . $this->getName() . " tripped $key at $count $summary\n", FILE_APPEND );
+                                               wfSuppressWarnings();
+                                               file_put_contents( $wgRateLimitLog, wfTimestamp( TS_MW ) . ' ' . wfWikiID() . ': ' . $this->getName() . " tripped $key at $count $summary\n", FILE_APPEND );
+                                               wfRestoreWarnings();
                                        }
                                        $triggered = true;
                                } else {
index 74c7014..3824df0 100644 (file)
@@ -35,10 +35,10 @@ class WantedPagesPage extends WantedQueryPage {
                $inc = $this->including();
 
                if ( $inc ) {
-                       @list( $limit, $nlinks ) = explode( '/', $par, 2 );
-                       $this->limit = (int)$limit;
+                       $parts = explode( '/', $par, 2 );
+                       $this->limit = (int)$parts[0];
                        // @todo FIXME: nlinks is ignored
-                       $nlinks = $nlinks === 'nlinks';
+                       $nlinks = isset( $parts[1] ) && $parts[1] === 'nlinks';
                        $this->offset = 0;
                } else {
                        $nlinks = true;