dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix positioning of jQuery.tipsy tooltip arrows"
[lhc/web/wiklou.git]
/
includes
/
media
/
SVG.php
diff --git
a/includes/media/SVG.php
b/includes/media/SVG.php
index
3e8d9e5
..
1118598
100644
(file)
--- a/
includes/media/SVG.php
+++ b/
includes/media/SVG.php
@@
-95,7
+95,7
@@
class SvgHandler extends ImageHandler {
$metadata = $this->unpackMetadata( $metadata );
if ( isset( $metadata['translations'] ) ) {
foreach ( $metadata['translations'] as $lang => $langType ) {
$metadata = $this->unpackMetadata( $metadata );
if ( isset( $metadata['translations'] ) ) {
foreach ( $metadata['translations'] as $lang => $langType ) {
- if ( $langType === S
vg
Reader::LANG_FULL_MATCH ) {
+ if ( $langType === S
VG
Reader::LANG_FULL_MATCH ) {
$langList[] = $lang;
}
}
$langList[] = $lang;
}
}
@@
-205,11
+205,12
@@
class SvgHandler extends ImageHandler {
$tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
$lnPath = "$tmpDir/" . basename( $srcPath );
$ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
$tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
$lnPath = "$tmpDir/" . basename( $srcPath );
$ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
+ /** @noinspection PhpUnusedLocalVariableInspection */
$cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
$cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
unlink( $lnPath );
rmdir( $tmpDir );
unlink( $lnPath );
rmdir( $tmpDir );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
} );
if ( !$ok ) {
wfDebugLog( 'thumbnail',
} );
if ( !$ok ) {
wfDebugLog( 'thumbnail',
@@
-307,9
+308,9
@@
class SvgHandler extends ImageHandler {
*/
function getImageSize( $file, $path, $metadata = false ) {
if ( $metadata === false ) {
*/
function getImageSize( $file, $path, $metadata = false ) {
if ( $metadata === false ) {
- $metadata = $file->getMeta
D
ata();
+ $metadata = $file->getMeta
d
ata();
}
}
- $metadata = $this->unpackMeta
D
ata( $metadata );
+ $metadata = $this->unpackMeta
d
ata( $metadata );
if ( isset( $metadata['width'] ) && isset( $metadata['height'] ) ) {
return array( $metadata['width'], $metadata['height'], 'SVG',
if ( isset( $metadata['width'] ) && isset( $metadata['height'] ) ) {
return array( $metadata['width'], $metadata['height'], 'SVG',
@@
-362,7
+363,7
@@
class SvgHandler extends ImageHandler {
$metadata = array( 'version' => self::SVG_METADATA_VERSION );
try {
$metadata += SVGMetadataExtractor::getMetadata( $filename );
$metadata = array( 'version' => self::SVG_METADATA_VERSION );
try {
$metadata += SVGMetadataExtractor::getMetadata( $filename );
- } catch (
MW
Exception $e ) { // @todo SVG specific exceptions
+ } catch ( Exception $e ) { // @todo SVG specific exceptions
// File not found, broken, etc.
$metadata['error'] = array(
'message' => $e->getMessage(),
// File not found, broken, etc.
$metadata['error'] = array(
'message' => $e->getMessage(),
@@
-375,9
+376,9
@@
class SvgHandler extends ImageHandler {
}
function unpackMetadata( $metadata ) {
}
function unpackMetadata( $metadata ) {
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
$unser = unserialize( $metadata );
$unser = unserialize( $metadata );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
if ( isset( $unser['version'] ) && $unser['version'] == self::SVG_METADATA_VERSION ) {
return $unser;
} else {
if ( isset( $unser['version'] ) && $unser['version'] == self::SVG_METADATA_VERSION ) {
return $unser;
} else {
@@
-410,9
+411,10
@@
class SvgHandler extends ImageHandler {
/**
* @param File $file
/**
* @param File $file
+ * @param bool|IContextSource $context Context to use (optional)
* @return array|bool
*/
* @return array|bool
*/
- function formatMetadata( $file ) {
+ function formatMetadata( $file
, $context = false
) {
$result = array(
'visible' => array(),
'collapsed' => array()
$result = array(
'visible' => array(),
'collapsed' => array()
@@
-486,7
+488,7
@@
class SvgHandler extends ImageHandler {
function makeParamString( $params ) {
$lang = '';
if ( isset( $params['lang'] ) && $params['lang'] !== 'en' ) {
function makeParamString( $params ) {
$lang = '';
if ( isset( $params['lang'] ) && $params['lang'] !== 'en' ) {
- $params['lang'] =
mb_
strtolower( $params['lang'] );
+ $params['lang'] = strtolower( $params['lang'] );
$lang = "lang{$params['lang']}-";
}
if ( !isset( $params['width'] ) ) {
$lang = "lang{$params['lang']}-";
}
if ( !isset( $params['width'] ) ) {