User:MarkAHershberger/sandbox'
See this post for reference.
modified includes/media/SVG.php
@@ -234,6 +234,7 @@ class SvgHandler extends ImageHandler {
// Make a temp dir with a symlink to the local copy in it.
// This plays well with rsvg-convert policy for external entities.
// https://git.gnome.org/browse/librsvg/commit/?id=f01aded72c38f0e18bc7ff67dee800e380251c8e
+ /* TH-20190630 Fix problem with SVG thumb creation due to symlink
$tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
$lnPath = "$tmpDir/" . basename( $srcPath );
$ok = mkdir( $tmpDir, 0771 );
@@ -247,7 +248,9 @@ class SvgHandler extends ImageHandler {
);
}
$ok = symlink( $srcPath, $lnPath );
+ */
/** @noinspection PhpUnusedLocalVariableInspection */
+ /* TH-20190630
$cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
Wikimedia\suppressWarnings();
unlink( $lnPath );
@@ -265,6 +268,10 @@ class SvgHandler extends ImageHandler {
}
$status = $this->rasterize( $lnPath, $dstPath, $physicalWidth, $physicalHeight, $lang );
+ */
+ /* TH-20190630 changed $lnPath to $srcPath since symlink doesn't work in IIS
+ */
+ $status = $this->rasterize( $srcPath, $dstPath, $physicalWidth, $physicalHeight, $lang );
if ( $status === true ) {
return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
} else {