* using htmlspecialchars() for safe XHTML output
[lhc/web/wiklou.git] / includes / Image.php
index 39ceca5..6644084 100644 (file)
@@ -1427,6 +1427,7 @@ class Image
                        }
                }
                $db->freeResult( $res );
+               wfProfileOut( $fname );
                return $retVal;
        }
        /**
@@ -1437,20 +1438,21 @@ class Image
         *
         * @return array
         */
-       function retrieveExifData () {
-               if ( $this->getMimeType() !== "image/jpeg" ) return array ();
+       function retrieveExifData() {
+               if ( $this->getMimeType() !== "image/jpeg" ) 
+                       return array();
 
                $exif = new Exif( $this->imagePath );
                return $exif->getFilteredData();
        }
                
-       function getExifData () {
+       function getExifData() {
                global $wgRequest;
                if ( $this->metadata === '0' )
                        return array();
                
                $purge = $wgRequest->getVal( 'action' ) == 'purge';
-               $ret = unserialize ( $this->metadata );
+               $ret = unserialize( $this->metadata );
 
                $oldver = isset( $ret['MEDIAWIKI_EXIF_VERSION'] ) ? $ret['MEDIAWIKI_EXIF_VERSION'] : 0;
                $newver = Exif::version();
@@ -1462,6 +1464,7 @@ class Image
                if ( isset( $ret['MEDIAWIKI_EXIF_VERSION'] ) )
                        unset( $ret['MEDIAWIKI_EXIF_VERSION'] );
                $format = new FormatExif( $ret );
+               
                return $format->getFormattedData();
        }
 
@@ -1669,7 +1672,7 @@ function wfScaleSVGUnit( $length ) {
                ''   => 1.0, // "User units" pixels by default
                '%'  => 2.0, // Fake it!
                );
-       if( preg_match( '/^(\d+)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
+       if( preg_match( '/^(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
                $length = floatval( $matches[1] );
                $unit = $matches[2];
                return round( $length * $unitLength[$unit] );