X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fmedia%2FSVGMetadataExtractor.php;h=e52bf0b26a1c7fad1e2a899d8d005eba454b824a;hb=57e631b78c111d7451b4ea1e8b44a464bcca1b04;hp=e00a5b380c71209c50df24d0b0177d8a248457a8;hpb=97402532d48de203925a850a4afa2d8f43e3dd9f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index e00a5b380c..e52bf0b26a 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -325,7 +325,7 @@ class SVGReader { if ( $this->reader->getAttribute( 'viewBox' ) ) { // min-x min-y width height - $viewBox = preg_split( '/\s+/', trim( $this->reader->getAttribute( 'viewBox' ) ) ); + $viewBox = preg_split( '/\s*[\s,]\s*/', trim( $this->reader->getAttribute( 'viewBox' ) ) ); if ( count( $viewBox ) == 4 ) { $viewWidth = $this->scaleSVGUnit( $viewBox[2] ); $viewHeight = $this->scaleSVGUnit( $viewBox[3] ); @@ -380,7 +380,11 @@ class SVGReader { '' => 1.0, // "User units" pixels by default ]; $matches = []; - if ( preg_match( '/^\s*(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)\s*$/', $length, $matches ) ) { + if ( preg_match( + '/^\s*([-+]?\d*(?:\.\d+|\d+)(?:[Ee][-+]?\d+)?)\s*(em|ex|px|pt|pc|cm|mm|in|%|)\s*$/', + $length, + $matches + ) ) { $length = floatval( $matches[1] ); $unit = $matches[2]; if ( $unit == '%' ) {