r86174 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86173‎ | r86174 | r86175 >
Date:02:19, 16 April 2011
Author:bawolff
Status:ok
Tags:
Comment:
(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.
Modified paths:
  • /trunk/phase3/includes/media/Exif.php (modified) (history)
  • /trunk/phase3/includes/media/FormatMetadata.php (modified) (history)
  • /trunk/phase3/includes/media/IPTC.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/FormatMetadata.php
@@ -1222,7 +1222,7 @@
12231223 *
12241224 * @return String of html-ish looking wikitext
12251225 */
1226 - public function collapseContactInfo( $vals ) {
 1226+ public static function collapseContactInfo( $vals ) {
12271227 if( ! ( isset( $vals['CiAdrExtadr'] )
12281228 || isset( $vals['CiAdrCity'] )
12291229 || isset( $vals['CiAdrCtry'] )
Index: trunk/phase3/includes/media/Exif.php
@@ -507,8 +507,10 @@
508508 * Use FormatMetadata to create formatted values for display to user
509509 * (is this ever used?)
510510 */
511 - private function makeFormattedData( ) {
512 - $this->mFormattedExifData = FormatMetadata::getFormattedData();
 511+ function makeFormattedData( ) {
 512+ wfDeprecated( __METHOD__ );
 513+ $this->mFormattedExifData = FormatMetadata::getFormattedData(
 514+ $this->mFilteredExifData );
513515 }
514516 /**#@-*/
515517
@@ -536,6 +538,7 @@
537539 * Its unclear if this is ever used.
538540 */
539541 function getFormattedData() {
 542+ wfDeprecated( __METHOD__ );
540543 if (!$this->mFormattedExifData) {
541544 $this->makeFormattedData();
542545 }
Index: trunk/phase3/includes/media/IPTC.php
@@ -525,10 +525,10 @@
526526 case "\x1b(x":
527527 $c = "CSA_Z243.4-1985-2";
528528 break;
529 - case "\x1b$(B":
530 - case "\x1b$B":
531 - case "\x1b&@\x1b$B":
532 - case "\x1b&@\x1b$(B":
 529+ case "\x1b\$(B":
 530+ case "\x1b\$B":
 531+ case "\x1b&@\x1b\$B":
 532+ case "\x1b&@\x1b\$(B":
533533 $c = "JIS_C6226-1983";
534534 break;
535535 case "\x1b-A": // iso-8859-1. at least for the high code characters.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86169Merge to trunk everything in img_metadata branch....bawolff01:23, 16 April 2011

Status & tagging log