Merge "mw.widgets.TitleWidget: Correct documentation"
[lhc/web/wiklou.git] / includes / media / Exif.php
index 3386868..052c39d 100644 (file)
@@ -294,9 +294,9 @@ class Exif {
 
                $this->debugFile( $this->basename, __FUNCTION__, true );
                if ( function_exists( 'exif_read_data' ) ) {
-                       wfSuppressWarnings();
+                       MediaWiki\suppressWarnings();
                        $data = exif_read_data( $this->file, 0, true );
-                       wfRestoreWarnings();
+                       MediaWiki\restoreWarnings();
                } else {
                        throw new MWException( "Internal error: exif_read_data not present. " .
                                "\$wgShowEXIF may be incorrectly set or not checked by an extension." );
@@ -390,8 +390,8 @@ class Exif {
                $this->charCodeString( 'GPSProcessingMethod' );
                $this->charCodeString( 'GPSAreaInformation' );
 
-               //ComponentsConfiguration should really be an array instead of a string...
-               //This turns a string of binary numbers into an array of numbers.
+               // ComponentsConfiguration should really be an array instead of a string...
+               // This turns a string of binary numbers into an array of numbers.
 
                if ( isset( $this->mFilteredExifData['ComponentsConfiguration'] ) ) {
                        $val = $this->mFilteredExifData['ComponentsConfiguration'];
@@ -401,16 +401,16 @@ class Exif {
                        for ( $i = 0; $i < $strLen; $i++ ) {
                                $ccVals[$i] = ord( substr( $val, $i, 1 ) );
                        }
-                       $ccVals['_type'] = 'ol'; //this is for formatting later.
+                       $ccVals['_type'] = 'ol'; // this is for formatting later.
                        $this->mFilteredExifData['ComponentsConfiguration'] = $ccVals;
                }
 
-               //GPSVersion(ID) is treated as the wrong type by php exif support.
-               //Go through each byte turning it into a version string.
-               //For example: "\x02\x02\x00\x00" -> "2.2.0.0"
+               // GPSVersion(ID) is treated as the wrong type by php exif support.
+               // Go through each byte turning it into a version string.
+               // For example: "\x02\x02\x00\x00" -> "2.2.0.0"
 
-               //Also change exif tag name from GPSVersion (what php exif thinks it is)
-               //to GPSVersionID (what the exif standard thinks it is).
+               // Also change exif tag name from GPSVersion (what php exif thinks it is)
+               // to GPSVersionID (what the exif standard thinks it is).
 
                if ( isset( $this->mFilteredExifData['GPSVersion'] ) ) {
                        $val = $this->mFilteredExifData['GPSVersion'];
@@ -448,7 +448,7 @@ class Exif {
                if ( isset( $this->mFilteredExifData[$prop] ) ) {
 
                        if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) {
-                               //invalid. Must be at least 9 bytes long.
+                               // invalid. Must be at least 9 bytes long.
 
                                $this->debug( $this->mFilteredExifData[$prop], __FUNCTION__, false );
                                unset( $this->mFilteredExifData[$prop] );
@@ -460,42 +460,42 @@ class Exif {
 
                        switch ( $charCode ) {
                                case "\x4A\x49\x53\x00\x00\x00\x00\x00":
-                                       //JIS
+                                       // JIS
                                        $charset = "Shift-JIS";
                                        break;
                                case "UNICODE\x00":
                                        $charset = "UTF-16" . $this->byteOrder;
                                        break;
-                               default: //ascii or undefined.
+                               default: // ascii or undefined.
                                        $charset = "";
                                        break;
                        }
                        if ( $charset ) {
-                               wfSuppressWarnings();
+                               MediaWiki\suppressWarnings();
                                $val = iconv( $charset, 'UTF-8//IGNORE', $val );
-                               wfRestoreWarnings();
+                               MediaWiki\restoreWarnings();
                        } else {
                                // if valid utf-8, assume that, otherwise assume windows-1252
                                $valCopy = $val;
-                               UtfNormal\Validator::quickIsNFCVerify( $valCopy ); //validates $valCopy.
+                               UtfNormal\Validator::quickIsNFCVerify( $valCopy ); // validates $valCopy.
                                if ( $valCopy !== $val ) {
-                                       wfSuppressWarnings();
+                                       MediaWiki\suppressWarnings();
                                        $val = iconv( 'Windows-1252', 'UTF-8//IGNORE', $val );
-                                       wfRestoreWarnings();
+                                       MediaWiki\restoreWarnings();
                                }
                        }
 
-                       //trim and check to make sure not only whitespace.
+                       // trim and check to make sure not only whitespace.
                        $val = trim( $val );
                        if ( strlen( $val ) === 0 ) {
-                               //only whitespace.
+                               // only whitespace.
                                $this->debug( $this->mFilteredExifData[$prop], __FUNCTION__, "$prop: Is only whitespace" );
                                unset( $this->mFilteredExifData[$prop] );
 
                                return;
                        }
 
-                       //all's good.
+                       // all's good.
                        $this->mFilteredExifData[$prop] = $val;
                }
        }