Pull-request: #16586 Fixes: #16585 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
a9f12a1391
@ -24,6 +24,7 @@ use function imagesx;
|
||||
use function imagesy;
|
||||
use function in_array;
|
||||
use function intval;
|
||||
use function round;
|
||||
use function str_replace;
|
||||
use function stripos;
|
||||
use function substr;
|
||||
@ -167,10 +168,10 @@ class TransformationWrapperController extends AbstractController
|
||||
. ($mime_options['charset'] ?? '');
|
||||
}
|
||||
|
||||
Core::downloadHeader($cn, $mime_type);
|
||||
Core::downloadHeader($cn ?? '', $mime_type ?? '');
|
||||
|
||||
if (! isset($_REQUEST['resize'])) {
|
||||
if (stripos($mime_type, 'html') === false) {
|
||||
if (stripos($mime_type ?? '', 'html') === false) {
|
||||
echo $row[$transform_key];
|
||||
} else {
|
||||
echo htmlspecialchars($row[$transform_key]);
|
||||
@ -194,11 +195,11 @@ class TransformationWrapperController extends AbstractController
|
||||
$ratioHeight = $srcHeight / $_REQUEST['newHeight'];
|
||||
|
||||
if ($ratioWidth < $ratioHeight) {
|
||||
$destWidth = $srcWidth / $ratioHeight;
|
||||
$destHeight = $_REQUEST['newHeight'];
|
||||
$destWidth = intval(round($srcWidth / $ratioHeight));
|
||||
$destHeight = intval($_REQUEST['newHeight']);
|
||||
} else {
|
||||
$destWidth = $_REQUEST['newWidth'];
|
||||
$destHeight = $srcHeight / $ratioWidth;
|
||||
$destWidth = intval($_REQUEST['newWidth']);
|
||||
$destHeight = intval(round($srcHeight / $ratioWidth));
|
||||
}
|
||||
|
||||
if ($_REQUEST['resize']) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user