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

Revision: 90218
Author:   ialex
Date:     2011-06-16 17:38:26 +0000 (Thu, 16 Jun 2011)
Log Message:
-----------
Removed usage of error suppression operator

Modified Paths:
--------------
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2011-06-16 17:34:40 UTC (rev 
90217)
+++ trunk/phase3/includes/GlobalFunctions.php   2011-06-16 17:38:26 UTC (rev 
90218)
@@ -1075,7 +1075,7 @@
        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 wfVarDump( $var ) {
        global $wgOut;
        $s = str_replace( "\n", "<br />\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 @@
 
        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] );
                }
        }
 


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

Reply via email to