X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FFormatMetadata.php;h=b98d7f1e746549a743bd21c836ccc31d9974e8fc;hb=138298b397b308ad6e4bfc7088884d90e8ac1e37;hp=f683da2c02609afaed9bc01b15cdab20624071b9;hpb=9bf44d08f938cc9a85dc647b8a00665d5bd01fb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index f683da2c02..b98d7f1e74 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -20,7 +20,7 @@ * @ingroup Media * @author Ævar Arnfjörð Bjarmason * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason, 2009 Brent Garber, 2010 Brian Wolff - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License + * @license GPL-2.0-or-later * @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification * @file */ @@ -271,7 +271,7 @@ class FormatMetadata extends ContextSource { // TODO: YCbCrCoefficients #p27 (see annex E) case 'ExifVersion': case 'FlashpixVersion': - $val = "$val" / 100; + $val = (int)$val / 100; break; case 'ColorSpace': @@ -787,7 +787,7 @@ class FormatMetadata extends ContextSource { } } if ( is_numeric( $val ) ) { - $fNumber = pow( 2, $val / 2 ); + $fNumber = 2 ** ( $val / 2 ); if ( $fNumber !== false ) { $val = $this->msg( 'exif-maxaperturevalue-value', $this->formatNum( $val ), @@ -1859,9 +1859,9 @@ class FormatMetadata extends ContextSource { // drop all characters which are not valid in an XML tag name // a bunch of non-ASCII letters would be valid but probably won't // be used so we take the easy way - $key = preg_replace( '/[^a-zA-z0-9_:.-]/', '', $key ); + $key = preg_replace( '/[^a-zA-z0-9_:.\-]/', '', $key ); // drop characters which are invalid at the first position - $key = preg_replace( '/^[\d-.]+/', '', $key ); + $key = preg_replace( '/^[\d\-.]+/', '', $key ); if ( $key == '' ) { $key = '_';