From 0e2c2828fa17c53a45682b7513b7ca6d6adc8752 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 10 Jan 2008 10:05:50 +0000 Subject: [PATCH] search cron.php is included from search block, the config.php was already included in admin/cron.php - MFC --- search/cron.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/search/cron.php b/search/cron.php index 0d115ef72b0..017c2fd45ae 100644 --- a/search/cron.php +++ b/search/cron.php @@ -12,7 +12,10 @@ * adds documents created since the last index run */ - require_once("$CFG->dirroot/config.php"); + if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page + } + require_once("$CFG->dirroot/search/lib.php"); if (!search_check_php5()) {