diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
commit | 222b01f5169f1c7e69762e0e8904c24f78f71882 (patch) | |
tree | 8e932e12546bb991357ec48eb1638d1770be7a35 /includes/Exif.php | |
parent | 00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff) |
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/Exif.php')
-rw-r--r-- | includes/Exif.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/includes/Exif.php b/includes/Exif.php index 9e54bd55..594e633a 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -558,7 +558,7 @@ class Exif { * @param $fname String: * @param $action Mixed: , default NULL. */ - function debug( $in, $fname, $action = NULL ) { + function debug( $in, $fname, $action = null ) { if ( !$this->log ) { return; } @@ -1043,6 +1043,14 @@ class FormatExif { $this->formatNum( $val ) ); break; + // Do not transform fields with pure text. + // For some languages the formatNum() conversion results to wrong output like + // foo,bar@example,com or foo٫bar@example٫com + case 'ImageDescription': + case 'Artist': + case 'Copyright': + $tags[$tag] = htmlspecialchars( $val ); + break; default: $tags[$tag] = $this->formatNum( $val ); break; @@ -1080,11 +1088,13 @@ class FormatExif { * @return mixed A floating point number or whatever we were fed */ function formatNum( $num ) { + global $wgLang; + $m = array(); if ( preg_match( '/^(\d+)\/(\d+)$/', $num, $m ) ) - return $m[2] != 0 ? $m[1] / $m[2] : $num; + return $wgLang->formatNum( $m[2] != 0 ? $m[1] / $m[2] : $num ); else - return $num; + return $wgLang->formatNum( $num ); } /** @@ -1103,7 +1113,7 @@ class FormatExif { $gcd = $this->gcd( $numerator, $denominator ); if( $gcd != 0 ) { // 0 shouldn't happen! ;) - return $numerator / $gcd . '/' . $denominator / $gcd; + return $this->formatNum( $numerator / $gcd ) . '/' . $this->formatNum( $denominator / $gcd ); } } return $this->formatNum( $num ); |