Merge "Ignore EXIF data in FormatMetadata::fetchExtendedMetadata()"
[lhc/web/wiklou.git] / includes / media / FormatMetadata.php
index 07d7618..7246072 100644 (file)
@@ -1595,11 +1595,8 @@ class FormatMetadata extends ContextSource {
        public function fetchExtendedMetadata( File $file ) {
                global $wgMemc;
 
-               wfProfileIn( __METHOD__ );
-
                // If revision deleted, exit immediately
                if ( $file->isDeleted( File::DELETED_FILE ) ) {
-                       wfProfileOut( __METHOD__ );
 
                        return array();
                }
@@ -1614,7 +1611,7 @@ class FormatMetadata extends ContextSource {
                $cachedValue = $wgMemc->get( $cacheKey );
                if (
                        $cachedValue
-                       && wfRunHooks( 'ValidateExtendedMetadataCache', array( $cachedValue['timestamp'], $file ) )
+                       && Hooks::run( 'ValidateExtendedMetadataCache', array( $cachedValue['timestamp'], $file ) )
                ) {
                        $extendedMetadata = $cachedValue['data'];
                } else {
@@ -1634,8 +1631,6 @@ class FormatMetadata extends ContextSource {
                        $wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime );
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $extendedMetadata;
        }
 
@@ -1657,8 +1652,6 @@ class FormatMetadata extends ContextSource {
                        return $file->getExtendedMetadata() ?: array();
                }
 
-               wfProfileIn( __METHOD__ );
-
                $uploadDate = wfTimestamp( TS_ISO_8601, $file->getTimestamp() );
 
                $fileMetadata = array(
@@ -1686,19 +1679,6 @@ class FormatMetadata extends ContextSource {
                        );
                }
 
-               $common = $file->getCommonMetaArray();
-
-               if ( $common !== false ) {
-                       foreach ( $common as $key => $value ) {
-                               $fileMetadata[$key] = array(
-                                       'value' => $value,
-                                       'source' => 'file-metadata',
-                               );
-                       }
-               }
-
-               wfProfileOut( __METHOD__ );
-
                return $fileMetadata;
        }
 
@@ -1715,9 +1695,8 @@ class FormatMetadata extends ContextSource {
        protected function getExtendedMetadataFromHook( File $file, array $extendedMetadata,
                &$maxCacheTime
        ) {
-               wfProfileIn( __METHOD__ );
 
-               wfRunHooks( 'GetExtendedMetadata', array(
+               Hooks::run( 'GetExtendedMetadata', array(
                        &$extendedMetadata,
                        $file,
                        $this->getContext(),
@@ -1732,8 +1711,6 @@ class FormatMetadata extends ContextSource {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $extendedMetadata;
        }