Skip to content

Commit 1cfe8e3

Browse files
committed
fix: esecuzione cron da riga di comando con redirectHTTPS attivo
1 parent 2eaa725 commit 1cfe8e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
// Lettura della configurazione
7070
$config = App::getConfig();
7171

72-
// Redirect al percorso HTTPS se impostato nella configurazione
73-
if (!empty($config['redirectHTTPS']) && !isHTTPS(true)) {
72+
// Redirect al percorso HTTPS se impostato nella configurazione e la richiesta è da browser
73+
if ($config['redirectHTTPS'] == true && !isHTTPS(true) && php_sapi_name() != "cli") {
7474
header('HTTP/1.1 301 Moved Permanently');
7575
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
7676
exit;

0 commit comments

Comments
 (0)