The variable $message_one is declared as static which means it retains its value on function re-entry. If "allow_url_fopen" is off, function _janode_check_404() works correctly on the first iteration, with early exit, but it sets $message_once to false. Each additional url will be tested, and will fail because the early exit is not available.
function _janode_check_404($janode) {
static $message_once = TRUE;
// check php var "allow_url_fopen" is true as we need it to fetch the URL
if (!ini_get('allow_url_fopen')) {
if ($message_once) {
watchdog('cron', 'PHP INI "allow_url_fopen" is false', WATCHDOG_NOTICE);
$message_once = FALSE;
return;
}
}
To fix, the return statement should be moved:
function _janode_check_404($janode) {
static $message_once = TRUE;
// check php var "allow_url_fopen" is true as we need it to fetch the URL
if (!ini_get('allow_url_fopen')) {
if ($message_once) {
watchdog('cron', 'PHP INI "allow_url_fopen" is false', WATCHDOG_NOTICE);
$message_once = FALSE;
}
return;
}
Comments
Comment #1
AjK commentedFixed, thanks. Expect release DRUPAL-5--1-3 soon that includes this fix.
for reference, commit that fixes issue: http://drupal.org/cvs?commit=128408
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.