From: skodak Date: Thu, 10 Jan 2008 10:01:06 +0000 (+0000) Subject: search cron.php is included from search block, the config.php was already included... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=307155469e4887ea4944d60ebfe2cfcf9bedef9c;p=moodle.git search cron.php is included from search block, the config.php was already included in admin/cron.php --- diff --git a/search/cron.php b/search/cron.php index 0d115ef72b..017c2fd45a 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()) {