From e596cfcf78820618d8c8d532408a091d5b795391 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sat, 16 Apr 2011 02:19:05 +0000 Subject: [PATCH] (Follow-up r86169) Fix three minor issues Reedy found. * Some strings were using double quotes needed the dollar sign escaped. (the strings had to do with detecting obscure text encodings for IPTC) * FormatMetadata::collapseContactInfo should be static (for some reason I never got any E_STRICT on this. I think the api suppresses E_STRICT somehow...) * Exif::get/makeFormattedMetadata method (which appears to no longer be used, and never was used, but kept in for compatability just in case) called another function without required argument. Also got changed from public to private somehow (which is generally a bad idea, especially when its only reason for being there is to preserve back-compat). Marked these functions as deprecated while I'm at it since they really should not be used. --- includes/media/Exif.php | 7 +++++-- includes/media/FormatMetadata.php | 2 +- includes/media/IPTC.php | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/includes/media/Exif.php b/includes/media/Exif.php index 42ebd5e33d..90a574b2e1 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -507,8 +507,10 @@ class Exif { * Use FormatMetadata to create formatted values for display to user * (is this ever used?) */ - private function makeFormattedData( ) { - $this->mFormattedExifData = FormatMetadata::getFormattedData(); + function makeFormattedData( ) { + wfDeprecated( __METHOD__ ); + $this->mFormattedExifData = FormatMetadata::getFormattedData( + $this->mFilteredExifData ); } /**#@-*/ @@ -536,6 +538,7 @@ class Exif { * Its unclear if this is ever used. */ function getFormattedData() { + wfDeprecated( __METHOD__ ); if (!$this->mFormattedExifData) { $this->makeFormattedData(); } diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index ca73f62e38..a68f9204cc 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -1222,7 +1222,7 @@ class FormatMetadata { * * @return String of html-ish looking wikitext */ - public function collapseContactInfo( $vals ) { + public static function collapseContactInfo( $vals ) { if( ! ( isset( $vals['CiAdrExtadr'] ) || isset( $vals['CiAdrCity'] ) || isset( $vals['CiAdrCtry'] ) diff --git a/includes/media/IPTC.php b/includes/media/IPTC.php index 642248242b..3db845b6e4 100644 --- a/includes/media/IPTC.php +++ b/includes/media/IPTC.php @@ -525,10 +525,10 @@ class IPTC { case "\x1b(x": $c = "CSA_Z243.4-1985-2"; break; - case "\x1b$(B": - case "\x1b$B": - case "\x1b&@\x1b$B": - case "\x1b&@\x1b$(B": + case "\x1b\$(B": + case "\x1b\$B": + case "\x1b&@\x1b\$B": + case "\x1b&@\x1b\$(B": $c = "JIS_C6226-1983"; break; case "\x1b-A": // iso-8859-1. at least for the high code characters. -- 2.20.1