r91743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91742‎ | r91743 | r91744 >
Date:18:17, 8 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed some error suppression operators
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)
  • /trunk/phase3/includes/StreamFile.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWantedpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1477,7 +1477,9 @@
14781478 if( $count > $max ) {
14791479 wfDebug( __METHOD__ . ": tripped! $key at $count $summary\n" );
14801480 if( $wgRateLimitLog ) {
1481 - @file_put_contents( $wgRateLimitLog, wfTimestamp( TS_MW ) . ' ' . wfWikiID() . ': ' . $this->getName() . " tripped $key at $count $summary\n", FILE_APPEND );
 1481+ wfSuppressWarnings();
 1482+ file_put_contents( $wgRateLimitLog, wfTimestamp( TS_MW ) . ' ' . wfWikiID() . ': ' . $this->getName() . " tripped $key at $count $summary\n", FILE_APPEND );
 1483+ wfRestoreWarnings();
14821484 }
14831485 $triggered = true;
14841486 } else {
Index: trunk/phase3/includes/Revision.php
@@ -754,8 +754,8 @@
755755 # Use external methods for external objects, text in table is URL-only then
756756 if ( in_array( 'external', $flags ) ) {
757757 $url = $text;
758 - @list(/* $proto */, $path ) = explode( '://', $url, 2 );
759 - if( $path == '' ) {
 758+ $parts = explode( '://', $url, 2 );
 759+ if( count( $parts ) == 1 || $parts[1] == '' ) {
760760 wfProfileOut( __METHOD__ );
761761 return false;
762762 }
Index: trunk/phase3/includes/StreamFile.php
@@ -10,7 +10,9 @@
1111 * @param $headers array
1212 */
1313 function wfStreamFile( $fname, $headers = array() ) {
14 - $stat = @stat( $fname );
 14+ wfSuppressWarnings();
 15+ $stat = stat( $fname );
 16+ wfRestoreWarnings();
1517 if ( !$stat ) {
1618 header( 'HTTP/1.0 404 Not Found' );
1719 header( 'Cache-Control: no-cache' );
Index: trunk/phase3/includes/specials/SpecialWantedpages.php
@@ -35,10 +35,10 @@
3636 $inc = $this->including();
3737
3838 if ( $inc ) {
39 - @list( $limit, $nlinks ) = explode( '/', $par, 2 );
40 - $this->limit = (int)$limit;
 39+ $parts = explode( '/', $par, 2 );
 40+ $this->limit = (int)$parts[0];
4141 // @todo FIXME: nlinks is ignored
42 - $nlinks = $nlinks === 'nlinks';
 42+ $nlinks = isset( $parts[1] ) && $parts[1] === 'nlinks';
4343 $this->offset = 0;
4444 } else {
4545 $nlinks = true;

Status & tagging log