From 5e4b48f19b2203d501831f11d42353d00b85b5e7 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 9 Sep 2025 15:30:29 +0900 Subject: [PATCH] Prevent direct access to cron.php on CLI --- common/scripts/cron.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/scripts/cron.php b/common/scripts/cron.php index 5d3ff146d..954d6a062 100644 --- a/common/scripts/cron.php +++ b/common/scripts/cron.php @@ -4,14 +4,18 @@ * This script runs the task queue. * * Unlike other scripts provided with Rhymix, it can be called - * both on the command line and over the network. + * both on the CLI (through index.php) and over the network (directly). */ define('RXQUEUE_CRON', true); // If called on the CLI, run additional checks. if (PHP_SAPI === 'cli') { - require_once __DIR__ . '/common.php'; + if (!defined('RX_VERSION')) + { + echo "Error: This script must not be called directly.\n"; + exit(1); + } } else {