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

@ -23,7 +23,7 @@ $html = '';
switch ($mode) {
case 'create':
$map->createSitemap();
if (file_exists(SITEMAP_DIR . '/sitemap.xml')) {
if (is_file(SITEMAP_DIR . '/sitemap.xml')) {
$html .= $lang['SITEMAP_CREATED'] . ': <b>' . bb_date(TIMENOW, $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
} else {
$html .= $lang['SITEMAP_NOT_CREATED'];
@ -31,7 +31,7 @@ switch ($mode) {
break;
case 'search_update':
if (!file_exists(SITEMAP_DIR . '/sitemap.xml')) {
if (!is_file(SITEMAP_DIR . '/sitemap.xml')) {
$map->createSitemap();
}

View file

@ -23,8 +23,9 @@ if (!$torrent) {
$this->ajax_die($lang['ERROR_BUILD']);
}
$file_contents = null;
$filename = get_attachments_dir() . '/' . $torrent['physical_filename'];
if (!file_exists($filename) || !$file_contents = file_get_contents($filename)) {
if (!is_file($filename) || !$file_contents = file_get_contents($filename)) {
$this->ajax_die($lang['ERROR_NO_ATTACHMENT'] . "\n\n" . htmlCHR($filename));
}