mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Replaced some file exists to is file (#1276)
* Replaced some file_exists to is_file * Update functions_thumbs.php * Updated * Update CronHelper.php * Updated * Update IPHelper.php * Updated * Update update_forums_atom.php * Update functions.php * Update Validate.php
This commit is contained in:
parent
e8a90b025c
commit
3626143879
24 changed files with 107 additions and 89 deletions
|
@ -24,13 +24,14 @@ function createThumbnail(string $source, string $newFile, string $mimeType): boo
|
|||
{
|
||||
global $attach_config;
|
||||
|
||||
// Get the file information
|
||||
$source = realpath($source);
|
||||
$min_filesize = (int)$attach_config['img_min_thumb_filesize'];
|
||||
$img_filesize = file_exists($source) ? filesize($source) : false;
|
||||
// Check for source image existence
|
||||
if (!$source = realpath($source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Checks the max allowed filesize
|
||||
if (!$img_filesize || $img_filesize <= $min_filesize) {
|
||||
$min_filesize = (int)$attach_config['img_min_thumb_filesize'];
|
||||
if (!filesize($source) || filesize($source) <= $min_filesize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -48,7 +49,7 @@ function createThumbnail(string $source, string $newFile, string $mimeType): boo
|
|||
}
|
||||
|
||||
// Check the thumbnail existence after creating
|
||||
if (!file_exists($newFile)) {
|
||||
if (!is_file($newFile)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue