Updated SVG detection for Giovanni

This commit is contained in:
markseu 2019-03-13 09:48:35 +01:00
parent 99614f4f27
commit bba3c61297

View file

@ -2976,9 +2976,9 @@ class YellowToolbox {
$dataBufferSizeMax = filesize($fileName);
$dataBufferSize = min($dataBufferSizeMax, 4096);
if ($dataBufferSize) $dataBuffer = fread($fileHandle, $dataBufferSize);
if (!feof($fileHandle) && preg_match("/<svg (.*?)>/", $dataBuffer, $matches)) {
if (preg_match("/ width=\"(\d+)\"/", $matches[1], $tokens)) $width = $tokens[1];
if (preg_match("/ height=\"(\d+)\"/", $matches[1], $tokens)) $height = $tokens[1];
if (!feof($fileHandle) && preg_match("/<svg\s(.*?)>/s", $dataBuffer, $matches)) {
if (preg_match("/\swidth=\"(\d+)\"/s", $matches[1], $tokens)) $width = $tokens[1];
if (preg_match("/\sheight=\"(\d+)\"/s", $matches[1], $tokens)) $height = $tokens[1];
$type = $fileType;
}
}