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:
Roman Kelesidis 2023-12-27 20:08:00 +07:00 committed by GitHub
commit 3626143879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 107 additions and 89 deletions

View file

@ -400,7 +400,7 @@ $userdata =& $user->data;
if (
empty($_POST) &&
!defined('IN_ADMIN') && !defined('IN_AJAX') &&
!file_exists(CRON_RUNNING) &&
!is_file(CRON_RUNNING) &&
(TorrentPier\Helpers\CronHelper::isEnabled() || defined('START_CRON'))
) {
if (TIMENOW - $bb_cfg['cron_last_check'] > $bb_cfg['cron_check_interval']) {
@ -443,13 +443,13 @@ if (
/**
* Exit if board is disabled via trigger
*/
if (($bb_cfg['board_disable'] || file_exists(BB_DISABLED)) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !defined('IN_LOGIN')) {
if (($bb_cfg['board_disable'] || is_file(BB_DISABLED)) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !defined('IN_LOGIN')) {
http_response_code(503);
if ($bb_cfg['board_disable']) {
// admin lock
send_no_cache_headers();
bb_die('BOARD_DISABLE');
} elseif (file_exists(BB_DISABLED)) {
} elseif (is_file(BB_DISABLED)) {
// trigger lock
TorrentPier\Helpers\CronHelper::releaseDeadlock();
send_no_cache_headers();