From 9027c35dcab45e7d35d979f3f1059d863943a689 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 16 Jun 2011 17:38:26 +0000 Subject: [PATCH] Removed usage of error suppression operator --- includes/GlobalFunctions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 022f69c6ea..19a2fdb265 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1075,7 +1075,7 @@ function wfHostname() { if ( is_null( $host ) ) { if ( function_exists( 'posix_uname' ) ) { // This function not present on Windows - $uname = @posix_uname(); + $uname = posix_uname(); } else { $uname = false; } @@ -1814,7 +1814,7 @@ function wfDiff( $before, $after, $params = '-u' ) { function wfVarDump( $var ) { global $wgOut; $s = str_replace( "\n", "
\n", var_export( $var, true ) . "\n" ); - if ( headers_sent() || !@is_object( $wgOut ) ) { + if ( headers_sent() || !isset( $wgOut ) || !is_object( $wgOut ) ) { print $s; } else { $wgOut->addHTML( $s ); @@ -1937,12 +1937,12 @@ function wfAcceptToPrefs( $accept, $def = '*/*' ) { foreach( $parts as $part ) { # @todo FIXME: Doesn't deal with params like 'text/html; level=1' - @list( $value, $qpart ) = explode( ';', trim( $part ) ); + $values = explode( ';', trim( $part ) ); $match = array(); - if( !isset( $qpart ) ) { - $prefs[$value] = 1.0; - } elseif( preg_match( '/q\s*=\s*(\d*\.\d+)/', $qpart, $match ) ) { - $prefs[$value] = floatval( $match[1] ); + if ( count( $values ) == 1 ) { + $prefs[$values[0]] = 1.0; + } elseif ( preg_match( '/q\s*=\s*(\d*\.\d+)/', $values[1], $match ) ) { + $prefs[$values[0]] = floatval( $match[1] ); } } -- 2.20.1