Skip to content

Commit

Permalink
Correction Include()
Browse files Browse the repository at this point in the history
Peut être remplacé par require si la présence du fichier est testé avant
  • Loading branch information
darknoon29 committed Jun 20, 2024
1 parent 0089ad2 commit d393958
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,15 @@ function init_mod_cache()
$filename = 'cache/cache_mod.php';

if (file_exists($filename)) {
include $filename;
require_once $filename;
// regeneration si besoin
if ((filemtime($filename) + $server_config['mod_cache']) < time()) {
generate_mod_cache();
}
} else {
generate_mod_cache();
if (file_exists($filename)) {
include $filename; // on reinjecte le fichier s'il existe'
require_once $filename;
}
}
}
Expand All @@ -501,15 +501,15 @@ function init_serverconfig()
$filename = 'cache/cache_config.php';

if (file_exists($filename)) {
include $filename;
require_once $filename;
// regeneration si besoin
if ((filemtime($filename) + $server_config['config_cache']) < time()) {
generate_config_cache();
}
} else {
generate_config_cache();
if (file_exists($filename)) {
include $filename; // on reinjecte le fichier s'il existe'
require_once $filename;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions views/galaxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//si autorisé server_show_positionhided doit etre a 1 !!!!!!!!!!!
//todo info a communiquer avec release
if ($tInfosGroups["server_show_positionhided"] == 1) {
if (($server_config["portee_missil"] != "0" && $server_config["portee_missil"] != "")) {
if ($server_config["portee_missil"] != "0" && $server_config["portee_missil"] != "") {
$missil = galaxy_portee_missiles($galaxy, $system);
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@
<?php $string_delfavorites = "alert('" . $lang['GALAXY_NO_FAVORITES_MESSAGE'] . "')"; ?>
<?php endif; ?>

<input class="og-button og-button-success" type="button" value="<?=($lang['GALAXY_ADD_FAVORITES'] ?>" onclick="<?= $string_addfavorites ?>">
<input class="og-button og-button-success" type="button" value="<?= $lang['GALAXY_ADD_FAVORITES'] ?>" onclick="<?= $string_addfavorites ?>">
<input class="og-button og-button-danger" type="button" value="<?= $lang['GALAXY_REMOVE_FAVORITES'] ?>" onclick="<?= $string_delfavorites ?>">
</td>
</tr>
Expand Down

0 comments on commit d393958

Please sign in to comment.