Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.3
-
Fix Version/s: 1.9.4
-
Component/s: Administration
-
Labels:None
-
Environment:Unix + PHP 5.2.6
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
I am executing cron.php the recommended way - via PHP's CLI instead of accessing it with a browser, having browser access completely disallowed (Site Administration -> Security -> Site policies -> Cron execution via command line only: Yes). My crontab entry is:
*/30 * * * * php -d safe_mode="off" -d open_basedir="" /path_to/moodle/admin/cron.php > /dev/null
However, this writes a warning to STDOUT, which will then get emailed every time:
PHP Notice: Undefined index: REMOTE_ADDR in /path_to/moodle/lib/moodlelib.php on line 7513
The notice of course does not harm, it is annoying however to receive all these emails. Thus, the code should be cleaned ensuring not producing any notice/warning.
The attached patch fixes this bug.