From dca01bff67adcfe2454cc2bf6c2300cfa83c5156 Mon Sep 17 00:00:00 2001
From: Damien McKenna <damien@mc-kenna.com>
Date: Mon, 14 Mar 2011 09:41:09 -0500
Subject: [PATCH] Issue #1092000 by DamienMcKenna: only accept numeric values from the 'update_max_fetch_time' variable.

---
 modules/update/update.fetch.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index ff69cbb..f50d130 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -100,7 +100,10 @@ function update_fetch_data_finished($success, $results) {
  */
 function _update_fetch_data() {
   $queue = DrupalQueue::get('update_fetch_tasks');
-  $end = time() + variable_get('update_max_fetch_time', UPDATE_MAX_FETCH_TIME);
+  // Only allow numerical values from 'update_max_fetch_time', avoid E_NOTICE
+  // from executing intval() on objects.
+  $update_max_fetch_time = variable_get('update_max_fetch_time', UPDATE_MAX_FETCH_TIME);
+  $end = time() + (is_object($update_max_fetch_time) ? 0 : intval($update_max_fetch_time));
   while (time() < $end && ($item = $queue->claimItem())) {
     _update_process_fetch_task($item->data);
     $queue->deleteItem($item);
-- 
1.7.3.5

