mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Fix fatal error in PHP 8.0 when thumbnail size is not given as integer
This commit is contained in:
parent
0118962a8f
commit
ae44f26bc5
3 changed files with 11 additions and 0 deletions
|
|
@ -506,7 +506,10 @@ class FileHandler
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sanitize params
|
||||||
$target_file = self::getRealPath($target_file);
|
$target_file = self::getRealPath($target_file);
|
||||||
|
$resize_width = intval($resize_width);
|
||||||
|
$resize_height = $resize_height === 'auto' ? 'auto' : intval($resize_height);
|
||||||
if(!$resize_width)
|
if(!$resize_width)
|
||||||
{
|
{
|
||||||
$resize_width = 100;
|
$resize_width = 100;
|
||||||
|
|
|
||||||
|
|
@ -698,6 +698,10 @@ class commentItem extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
// If signiture height setting is omitted, create a square
|
// If signiture height setting is omitted, create a square
|
||||||
|
if(!is_int($width))
|
||||||
|
{
|
||||||
|
$width = intval($width);
|
||||||
|
}
|
||||||
if(!$height || (!is_int($height) && !ctype_digit(strval($height)) && $height !== 'auto'))
|
if(!$height || (!is_int($height) && !ctype_digit(strval($height)) && $height !== 'auto'))
|
||||||
{
|
{
|
||||||
$height = $width;
|
$height = $width;
|
||||||
|
|
|
||||||
|
|
@ -1094,6 +1094,10 @@ class documentItem extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not specify its height, create a square
|
// If not specify its height, create a square
|
||||||
|
if(!is_int($width))
|
||||||
|
{
|
||||||
|
$width = intval($width);
|
||||||
|
}
|
||||||
if(!$height || (!is_int($height) && !ctype_digit(strval($height)) && $height !== 'auto'))
|
if(!$height || (!is_int($height) && !ctype_digit(strval($height)) && $height !== 'auto'))
|
||||||
{
|
{
|
||||||
$height = $width;
|
$height = $width;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue