(Follow-up r86169) Fix three minor issues Reedy found.
authorBrian Wolff <bawolff@users.mediawiki.org>
Sat, 16 Apr 2011 02:19:05 +0000 (02:19 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Sat, 16 Apr 2011 02:19:05 +0000 (02:19 +0000)
* 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
includes/media/FormatMetadata.php
includes/media/IPTC.php

index 42ebd5e..90a574b 100644 (file)
@@ -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();
                }
index ca73f62..a68f920 100644 (file)
@@ -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'] )
index 6422482..3db845b 100644 (file)
@@ -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.