=== modified file 'ca/ca.ca.inc'
--- ca/ca.ca.inc	2009-07-01 15:58:50 +0000
+++ ca/ca.ca.inc	2010-02-02 18:30:35 +0000
@@ -122,15 +122,13 @@
   $set_date_start = gmmktime(0, 0, 0, $settings['date']['month'], $settings['date']['day'], $settings['date']['year']);
   $set_date_end = gmmktime(23, 59, 59, $settings['date']['month'], $settings['date']['day'], $settings['date']['year']);
 
-  $curr_time = time();
-
   switch ($settings['operator']) {
     case 'before':
-      return $curr_time < $set_date_start;
+      return REQUEST_TIME < $set_date_start;
     case 'only':
-      return ($set_date_start < $curr_time) && ($curr_time < $set_date_end);
+      return ($set_date_start < REQUEST_TIME) && (REQUEST_TIME < $set_date_end);
     case 'after':
-      return $set_date_end < $curr_time;
+      return $set_date_end < REQUEST_TIME;
     default:
       return FALSE;
   }

=== modified file 'ca/ca.module'
--- ca/ca.module	2009-11-11 21:05:30 +0000
+++ ca/ca.module	2010-02-02 18:30:35 +0000
@@ -992,12 +992,12 @@
   if (!$result) {
     // If not, then insert it.
     db_query("INSERT INTO {ca_predicates} (pid, title, description, class, status, weight, uid, ca_trigger, conditions, actions, created, modified) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d, %d)",
-      $predicate['#pid'], $predicate['#title'], $predicate['#description'], $predicate['#class'], $predicate['#status'], $predicate['#weight'], $predicate['#uid'], $predicate['#trigger'], serialize($predicate['#conditions']), serialize($predicate['#actions']), time(), time());
+      $predicate['#pid'], $predicate['#title'], $predicate['#description'], $predicate['#class'], $predicate['#status'], $predicate['#weight'], $predicate['#uid'], $predicate['#trigger'], serialize($predicate['#conditions']), serialize($predicate['#actions']), REQUEST_TIME, REQUEST_TIME);
   }
   else {
     // Otherwise, update it.
     db_query("UPDATE {ca_predicates} SET title = '%s', description = '%s', class = '%s', status = %d, weight = %d, uid = %d, ca_trigger = '%s', conditions = '%s', actions = '%s', modified = %d WHERE pid = '%s'",
-      $predicate['#title'], $predicate['#description'], $predicate['#class'], $predicate['#status'], $predicate['#weight'], $predicate['#uid'], $predicate['#trigger'], serialize($predicate['#conditions']), serialize($predicate['#actions']), time(), $predicate['#pid']);
+      $predicate['#title'], $predicate['#description'], $predicate['#class'], $predicate['#status'], $predicate['#weight'], $predicate['#uid'], $predicate['#trigger'], serialize($predicate['#conditions']), serialize($predicate['#actions']), REQUEST_TIME, $predicate['#pid']);
   }
 }
 

=== modified file 'docs/hooks.php'
--- docs/hooks.php	2010-01-04 15:07:02 +0000
+++ docs/hooks.php	2010-02-02 18:30:35 +0000
@@ -1627,7 +1627,7 @@
     uc_cart_remove_item($nid, $cid, $data);
   }
   else {
-    db_query("UPDATE {uc_cart_products} SET qty = %d, changed = %d WHERE nid = %d AND cart_id = '%s' AND data = '%s'", $qty, time(), $nid, $cid, serialize($data));
+    db_query("UPDATE {uc_cart_products} SET qty = %d, changed = %d WHERE nid = %d AND cart_id = '%s' AND data = '%s'", $qty, REQUEST_TIME, $nid, $cid, serialize($data));
   }
 
   // Rebuild the items hash

=== modified file 'payment/uc_authorizenet/uc_authorizenet.module'
--- payment/uc_authorizenet/uc_authorizenet.module	2010-01-22 19:48:20 +0000
+++ payment/uc_authorizenet/uc_authorizenet.module	2010-02-02 18:30:35 +0000
@@ -288,10 +288,10 @@
  */
 function _uc_authorizenet_cim_profile_create_request($order) {
   return array(
-    'refId' => substr($order->order_id .'-'. time(), 0, 20),
+    'refId' => substr($order->order_id .'-'. REQUEST_TIME, 0, 20),
     'profile' => array(
       'merchantCustomerId' => substr($order->uid, 0, 20),
-      'description' => substr(t('Order @order taking place at @date', array('@order' => $order->order_id, '@date' => format_date(time()))), 0, 255),
+      'description' => substr(t('Order @order taking place at @date', array('@order' => $order->order_id, '@date' => format_date(REQUEST_TIME))), 0, 255),
       'email' => substr($order->primary_email, 0, 255),
       'paymentProfiles' => array(
         'billTo' => _uc_authorize_cim_xml_billto($order),
@@ -379,7 +379,7 @@
   }
   else {
     return array(
-      'refId' => substr($order->order_id .'-'. time(), 0, 20),
+      'refId' => substr($order->order_id .'-'. REQUEST_TIME, 0, 20),
       'transaction' => array(
         'profileTransAuthCapture' => array(
           'amount' => $amount,
@@ -761,7 +761,7 @@
 
   // Build the data array for the request.
   $data = array(
-    'refId' => substr($order->order_id .'-'. time(), 0, 20),
+    'refId' => substr($order->order_id .'-'. REQUEST_TIME, 0, 20),
     'subscription' => array(
       'name' => substr(t('Order @order_id', array('@order_id' => $order->order_id)), 0, 50),
       'paymentSchedule' => array(
@@ -887,7 +887,7 @@
 
   // Build the data array for the request.
   $data = array(
-    'refId' => substr($order->order_id .'-'. time(), 0, 20),
+    'refId' => substr($order->order_id .'-'. REQUEST_TIME, 0, 20),
     'subscriptionId' => $subscription_id,
     'subscription' => $updates
   );
@@ -935,7 +935,7 @@
 
   // Build the data array for the request.
   $data = array(
-    'refId' => substr($order->order_id .'-'. time(), 0, 20),
+    'refId' => substr($order->order_id .'-'. REQUEST_TIME, 0, 20),
     'subscriptionId' => $subscription_id,
   );
 

=== modified file 'payment/uc_credit/uc_credit.admin.inc'
--- payment/uc_credit/uc_credit.admin.inc	2009-07-11 19:04:32 +0000
+++ payment/uc_credit/uc_credit.admin.inc	2010-02-02 18:30:35 +0000
@@ -162,7 +162,7 @@
   $options = array();
 
   // Log a reference to the order for testing.
-  // $order->data = uc_credit_log_reference($order->order_id, substr(md5(time()), 0, 16), '4111111111111111');
+  // $order->data = uc_credit_log_reference($order->order_id, substr(md5(REQUEST_TIME), 0, 16), '4111111111111111');
 
   foreach ((array) $order->data['cc_txns']['references'] as $ref_id => $data) {
     $options[$ref_id] = t('@ref_id - @date - (Last 4) @card', array('@ref_id' => strtoupper($ref_id), '@date' => format_date($data['created'], 'small'), '@card' => $data['card']));

=== modified file 'payment/uc_credit/uc_credit.module'
--- payment/uc_credit/uc_credit.module	2010-01-25 16:37:01 +0000
+++ payment/uc_credit/uc_credit.module	2010-02-02 18:30:35 +0000
@@ -900,7 +900,7 @@
         }
         else {
           // Replacement key generation suggested by Barry Jaspan for increased security.
-          fwrite($file, md5(drupal_get_token(serialize($_REQUEST) . serialize($_SERVER) . time())));
+          fwrite($file, md5(drupal_get_token(serialize($_REQUEST) . serialize($_SERVER) . REQUEST_TIME)));
           fclose($file);
 
           drupal_set_message(t('Credit card encryption key file generated. Card data will now be encrypted.'));
@@ -1506,7 +1506,7 @@
   // Add the authorization to the cc_txns.
   $data['cc_txns']['authorizations'][$auth_id] = array(
     'amount' => $amount,
-    'authorized' => time(),
+    'authorized' => REQUEST_TIME,
   );
 
   // Save the updated data array to the database.
@@ -1537,7 +1537,7 @@
   }
 
   // Otherwise log the capture timestamp to the authorization.
-  $data['cc_txns']['authorizations'][$auth_id]['captured'] = time();
+  $data['cc_txns']['authorizations'][$auth_id]['captured'] = REQUEST_TIME;
 
   // Save the updated data array to the database.
   db_query("UPDATE {uc_orders} SET data = '%s' WHERE order_id = %d", serialize($data), $order_id);
@@ -1566,7 +1566,7 @@
 
   $data['cc_txns']['references'][$ref_id] = array(
     'card' => substr($cc_number, -4),
-    'created' => time(),
+    'created' => REQUEST_TIME,
   );
 
   // Save the updated data array to the database.

=== modified file 'payment/uc_google_checkout/uc_google_checkout.module'
--- payment/uc_google_checkout/uc_google_checkout.module	2010-01-25 16:37:01 +0000
+++ payment/uc_google_checkout/uc_google_checkout.module	2010-02-02 19:03:02 +0000
@@ -623,7 +623,11 @@
 
   // Google's XML parser doesn't like named entities apparently.
   str_replace(array('&amp;', '&lt;', '&gt;'), array('&#x26;', '&#x3c;', '&#x3e;'), $request);
-  $response_obj = drupal_http_request($checkout_url .'/api/checkout/v2/'. $api .'/Merchant/'. $merchant_id, uc_google_checkout_headers(), 'POST', $request);
+  $response_obj = drupal_http_request($checkout_url .'/api/checkout/v2/'. $api .'/Merchant/'. $merchant_id, array(
+    'headers' =>uc_google_checkout_headers(),
+    'method' => 'POST',
+    'data' => $request,
+  ));
   if ($response_obj->error) {
     watchdog('google', '@error', array('@error' => $response_obj->error), WATCHDOG_ERROR);
   }
@@ -1024,7 +1028,7 @@
 }
 
 function uc_google_checkout_notification_acknowledgement($serial_number) {
-  drupal_set_header('HTTP/1.1 200 OK');
+  drupal_set_header('200 OK');
   print '<?xml version="1.0" encoding="UTF-8"?>';
   print "\n";
   print '<notification-acknowledgment xmlns="http://checkout.google.com/schema/2" serial-number="'. $serial_number .'" />';
@@ -1035,7 +1039,7 @@
   if (is_null($message)) {
     $message = t('Unknown order id or malformed XML.');
   }
-  drupal_set_header('HTTP/1.1 400 Bad Request');
+  drupal_set_header('400 Bad Request');
   watchdog('google', '!message', array('!message' => $message), WATCHDOG_ERROR);
   exit();
 }

=== modified file 'payment/uc_payment/uc_payment.module'
--- payment/uc_payment/uc_payment.module	2010-01-25 16:37:01 +0000
+++ payment/uc_payment/uc_payment.module	2010-02-02 18:30:35 +0000
@@ -618,7 +618,7 @@
   }
 
   db_query("INSERT INTO {uc_payment_receipts} (order_id, method, amount, uid, data, comment, received) VALUES (%d, '%s', %f, %d, '%s', '%s', %d)",
-    $order_id, $method_name, $amount, $uid, $data, $comment, time());
+    $order_id, $method_name, $amount, $uid, $data, $comment, REQUEST_TIME);
 
   $order = uc_order_load($order_id);
   $account = user_load($uid);

=== modified file 'payment/uc_payment_pack/uc_payment_pack.admin.inc'
--- payment/uc_payment_pack/uc_payment_pack.admin.inc	2009-07-11 19:04:32 +0000
+++ payment/uc_payment_pack/uc_payment_pack.admin.inc	2010-02-02 18:30:35 +0000
@@ -51,9 +51,9 @@
     '#title' => t('Expected clear date'),
     '#collapsible' => FALSE,
   );
-  $form['clear']['clear_month'] = uc_select_month(NULL, format_date(time(), 'custom', 'n'));
-  $form['clear']['clear_day'] = uc_select_day(NULL, format_date(time(), 'custom', 'j'));
-  $form['clear']['clear_year'] = uc_select_year(NULL, format_date(time(), 'custom', 'Y'), format_date(time(), 'custom', 'Y'), format_date(time(), 'custom', 'Y') + 1);
+  $form['clear']['clear_month'] = uc_select_month(NULL, format_date(REQUEST_TIME, 'custom', 'n'));
+  $form['clear']['clear_day'] = uc_select_day(NULL, format_date(REQUEST_TIME, 'custom', 'j'));
+  $form['clear']['clear_year'] = uc_select_year(NULL, format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y') + 1);
   foreach (array('clear_month', 'clear_day', 'clear_year') as $key) {
     $form['clear'][$key]['#prefix'] = '<div style="float: left; margin-right: 1em;">';
     $form['clear'][$key]['#suffix'] = '</div>';

=== modified file 'payment/uc_payment_pack/uc_payment_pack.module'
--- payment/uc_payment_pack/uc_payment_pack.module	2009-09-15 15:00:54 +0000
+++ payment/uc_payment_pack/uc_payment_pack.module	2010-02-02 18:30:35 +0000
@@ -256,14 +256,14 @@
 
 function uc_payment_method_cod_form($form_state, $order) {
   $form['table1'] = array('#value' => '<style>.cod-table div, .cod-table { display: inline; }.cod-table tbody { border-top: 0px; }</style><table class="cod-table"><tr><td class="form-item" colspan="3"><label>'. t('Enter a desired delivery date:') .'</label></td></tr><tr><td>');
-  $month = (!empty($order->payment_details['delivery_month'])) ? $order->payment_details['delivery_month'] : format_date(time(), 'custom', 'n');
+  $month = (!empty($order->payment_details['delivery_month'])) ? $order->payment_details['delivery_month'] : format_date(REQUEST_TIME, 'custom', 'n');
   $form['cod_delivery_month'] = uc_select_month(NULL, $month);
   $form['table2'] = array('#value' => '</td><td>');
-  $day = (!empty($order->payment_details['delivery_day'])) ? $order->payment_details['delivery_day'] : format_date(time(), 'custom', 'j');
+  $day = (!empty($order->payment_details['delivery_day'])) ? $order->payment_details['delivery_day'] : format_date(REQUEST_TIME, 'custom', 'j');
   $form['cod_delivery_day'] = uc_select_day(NULL, $day);
   $form['table3'] = array('#value' => '</td><td>');
-  $year = (!empty($order->payment_details['delivery_year'])) ? $order->payment_details['delivery_year'] : format_date(time(), 'custom', 'Y');
-  $form['cod_delivery_year'] = uc_select_year(NULL, $year, format_date(time(), 'custom', 'Y'), format_date(time(), 'custom', 'Y') + 1);
+  $year = (!empty($order->payment_details['delivery_year'])) ? $order->payment_details['delivery_year'] : format_date(REQUEST_TIME, 'custom', 'Y');
+  $form['cod_delivery_year'] = uc_select_year(NULL, $year, format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y') + 1);
   $form['table4'] = array('#value' => '</td></tr></table>');
 
   return $form;

=== modified file 'payment/uc_paypal/uc_paypal.module'
--- payment/uc_paypal/uc_paypal.module	2010-01-25 16:37:01 +0000
+++ payment/uc_paypal/uc_paypal.module	2010-02-02 18:30:35 +0000
@@ -373,7 +373,7 @@
       'COUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
       'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
       'DESC' => substr($desc, 0, 127),
-      'INVNUM' => $order_id .'-'. time(),
+      'INVNUM' => $order_id .'-'. REQUEST_TIME,
       'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
       'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, array('absolute' => TRUE)),
       'EMAIL' => substr($order->primary_email, 0, 127),
@@ -439,7 +439,7 @@
 
       // Log the IPN to the database.
       db_query("INSERT INTO {uc_payment_paypal_ipn} (order_id, txn_id, txn_type, mc_gross, status, receiver_email, payer_email, received) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', %d)",
-      $order->order_id, $nvp_response['TRANSACTIONID'], 'web_accept', $amount, 'Completed', '', $order->primary_email, time());
+      $order->order_id, $nvp_response['TRANSACTIONID'], 'web_accept', $amount, 'Completed', '', $order->primary_email, REQUEST_TIME);
 
       break;
     case 'FailureWithWarning':
@@ -665,7 +665,7 @@
     'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
     'DESC' => substr($desc, 0, 127),
-    'INVNUM' => $order->order_id .'-'. time(),
+    'INVNUM' => $order->order_id .'-'. REQUEST_TIME,
     'REQCONFIRMSHIPPING' => variable_get('uc_paypal_ec_rqconfirmed_addr', 0),
     'ADDROVERRIDE' => 1,
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
@@ -754,7 +754,7 @@
     'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
     'DESC' => substr($desc, 0, 127),
-    'INVNUM' => $order->order_id .'-'. time(),
+    'INVNUM' => $order->order_id .'-'. REQUEST_TIME,
     'REQCONFIRMSHIPPING' => variable_get('uc_paypal_ec_rqconfirmed_addr', 0),
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
     'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, array('absolute' => TRUE)),
@@ -824,7 +824,7 @@
     'PAYERID' => $_SESSION['PAYERID'],
     'AMT' => uc_price($order->order_total, $context, $options),
     'DESC' => substr($desc, 0, 127),
-    'INVNUM' => $order->order_id .'-'. time(),
+    'INVNUM' => $order->order_id .'-'. REQUEST_TIME,
     'BUTTONSOURCE' => 'Ubercart_ShoppingCart_EC_US',
     'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, array('absolute' => TRUE)),
     'ITEMAMT' => uc_price($subtotal, $context, $options),
@@ -916,7 +916,7 @@
     // Transaction information
     'currency_code' => variable_get('uc_paypal_wps_currency', 'USD'),
     'handling_cart' => uc_price($shipping, $context, $options),
-    'invoice' => $order->order_id .'-'. time(),
+    'invoice' => $order->order_id .'-'. REQUEST_TIME,
     'tax_cart' => uc_price($tax, $context, $options),
 
     // Shopping cart specific variables

=== modified file 'payment/uc_paypal/uc_paypal.pages.inc'
--- payment/uc_paypal/uc_paypal.pages.inc	2009-11-18 21:06:20 +0000
+++ payment/uc_paypal/uc_paypal.pages.inc	2010-02-02 18:43:14 +0000
@@ -56,7 +56,10 @@
     $host = variable_get('uc_paypal_wps_server', 'https://www.sandbox.paypal.com/cgi-bin/webscr');
   }
 
-  $response = drupal_http_request($host, array(), 'POST', $req);
+  $response = drupal_http_request($host, array(
+    'method' => 'POST',
+    'data' => $req,
+  ));
 
   // TODO: Change this to property_exists when we have a PHP requirement >= 5.1.
   if (array_key_exists('error', $response)) {
@@ -76,7 +79,7 @@
     }
 
     db_query("INSERT INTO {uc_payment_paypal_ipn} (order_id, txn_id, txn_type, mc_gross, status, receiver_email, payer_email, received) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', %d)",
-      $order_id, $txn_id, $txn_type, $payment_amount, $payment_status, $receiver_email, $payer_email, time());
+      $order_id, $txn_id, $txn_type, $payment_amount, $payment_status, $receiver_email, $payer_email, REQUEST_TIME);
 
     $context = array(
       'revision' => 'formatted-original',

=== modified file 'shipping/uc_ups/uc_ups.admin.inc'
--- shipping/uc_ups/uc_ups.admin.inc	2010-01-27 22:15:38 +0000
+++ shipping/uc_ups/uc_ups.admin.inc	2010-02-02 18:43:42 +0000
@@ -235,7 +235,10 @@
   $order_id = $_SESSION['ups']['order_id'];
   $packages = array_keys($_SESSION['ups']['packages']);
   $request = uc_ups_request_pickup($form_state['values']['digest'], $order_id, $packages);
-  $result = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'ShipAccept', array(), 'POST', $request);
+  $result = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'ShipAccept', array(
+    'method' => 'POST',
+    'data' => $request,
+  ));
   $response = new SimpleXMLElement($result->data);
   $code = (string)$response->Response->ResponseStatusCode;
   if ($code == 0) { // failed request

=== modified file 'shipping/uc_ups/uc_ups.module'
--- shipping/uc_ups/uc_ups.module	2010-01-25 16:37:01 +0000
+++ shipping/uc_ups/uc_ups.module	2010-02-02 18:44:35 +0000
@@ -805,7 +805,10 @@
     $orig->email = variable_get('uc_store_email', '');
     foreach (array_keys(array_filter(variable_get('uc_ups_services', array()))) as $ups_service) {
       $request = uc_ups_shipping_quote($ship_packages, $orig, $dest, $ups_service);
-      $resp = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'Rate', array(), 'POST', $request);
+      $resp = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'Rate', array(
+        'method' => 'POST',
+        'data' => $request,
+      ));
       if (user_access('configure quotes') && variable_get('uc_quote_display_debug', FALSE)) {
         $quotes[$ups_service]['debug'] .= /* '<pre>'. print_r($ship_packages, TRUE) .'</pre>' . */ htmlentities($request) .' <br /><br /> '. htmlentities($resp->data);
       }
@@ -1063,7 +1066,10 @@
 
   $request = uc_ups_shipment_request($_SESSION['ups']['packages'], $origin, $destination, $form_state['values']['service']);
   //print htmlentities($request);
-  $response_obj = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'ShipConfirm', array(), 'POST', $request);
+  $response_obj = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'ShipConfirm', array(
+    'method' => 'POST',
+    'data' => $request,
+  ));
   $response = new SimpleXMLElement($response_obj->data);
   //drupal_set_message('<pre>'. htmlentities($response->asXML()) .'</pre>');
   if (isset($response->Response->Error)) {
@@ -1154,7 +1160,10 @@
 function uc_ups_void_shipment($shipment_number, $tracking_numbers = array()) {
   $success = FALSE;
   $request = uc_ups_void_shipment_request($shipment_number, $tracking_numbers);
-  $resp = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'Void', array(), 'POST', $request);
+  $resp = drupal_http_request(variable_get('uc_ups_connection_address', 'https://wwwcie.ups.com/ups.app/xml/') .'Void', array(
+    'method' => 'POST',
+    'data' => $request,
+  ));
   $response = new SimpleXMLElement($resp->data);
   if (isset($response->Response)) {
     if (isset($response->Response->ResponseStatusCode)) {

=== modified file 'shipping/uc_usps/uc_usps.module'
--- shipping/uc_usps/uc_usps.module	2010-01-25 16:37:01 +0000
+++ shipping/uc_usps/uc_usps.module	2010-02-02 18:44:53 +0000
@@ -365,7 +365,10 @@
       $services['data']['debug'] .= htmlentities(urldecode($request)) ."<br />\n";
     }
 
-    $result = drupal_http_request($connection_url, array(), 'POST', $request);
+    $result = drupal_http_request($connection_url, array(
+      'method' => 'POST',
+      'data' => $request,
+    ));
 
     if (user_access('configure quotes') && variable_get('uc_quote_display_debug', FALSE)) {
       $services['data']['debug'] .= htmlentities($result->data) ."<br />\n";

=== modified file 'uc_cart/uc_cart.module'
--- uc_cart/uc_cart.module	2010-01-29 14:21:05 +0000
+++ uc_cart/uc_cart.module	2010-02-02 19:01:20 +0000
@@ -426,9 +426,9 @@
           $collapsible = FALSE;
         }
 
-        // Hack in some CSS to hide the block if necessary. drupal_add_css() is in Drupal 7 for this...
+        // Hack in some CSS to hide the block if necessary.
         if (variable_get('uc_cart_block_collapsed', TRUE)) {
-          drupal_set_html_head("<style type='text/css'>#cart-block-contents { display: none; }</style>");
+          drupal_add_css("#cart-block-contents { display: none; }", array('type' => 'inline'));
         }
 
         // Build the cart image if enabled.
@@ -1354,7 +1354,7 @@
       $item->model = $product->model;
 
       // Invoke hook_cart_item() with $op = 'load' in enabled modules.
-      foreach (module_list() as $module) {
+      foreach (module_implements('cart_item') as $module) {
         $func = $module .'_cart_item';
         if (function_exists($func)) {
           // $item must be passed by reference.
@@ -1423,7 +1423,7 @@
   $item->model = $product->model;
 
   // Invoke hook_cart_item() with $op = 'load' in enabled modules.
-  foreach (module_list() as $module) {
+  foreach (module_implements('cart_item') as $module) {
     $func = $module .'_cart_item';
     if (function_exists($func)) {
       // $item must be passed by reference.
@@ -1506,7 +1506,7 @@
 
   // If the item isn't in the cart yet, add it.
   if (is_null($item) || $item === FALSE) {
-    db_query("INSERT INTO {uc_cart_products} (cart_id, nid, qty, changed, data) VALUES ('%s', %d, %d, %d, '%s')", $cid, $node->nid, $qty, time(), serialize($data));
+    db_query("INSERT INTO {uc_cart_products} (cart_id, nid, qty, changed, data) VALUES ('%s', %d, %d, %d, '%s')", $cid, $node->nid, $qty, REQUEST_TIME, serialize($data));
     if ($msg) {
       drupal_set_message(t('<strong>@product-title</strong> added to <a href="!url">your shopping cart</a>.', array('@product-title' => $node->title, '!url' => url('cart'))));
     }
@@ -1554,7 +1554,7 @@
   // Invoke hook_cart_item() with $op = 'remove' in enabled modules.
   $result = db_query("SELECT c.*, n.title, n.vid FROM {node} n INNER JOIN {uc_cart_products} c ON n.nid = c.nid WHERE c.cart_id = '%s' AND c.nid = %d", $cart_id, $nid);
   if ($item = db_fetch_object($result)) {
-    foreach (module_list() as $module) {
+    foreach (module_implements('cart_item') as $module) {
       $func = $module .'_cart_item';
       if (function_exists($func)) {
         // $item must be passed by reference.
@@ -1677,7 +1677,7 @@
   $result = array();
 
   // See if any other modules have a say in the matter...
-  foreach (module_list() as $module) {
+  foreach (module_implements('cart_item') as $module) {
     $func = $module .'_cart_item';
     if (function_exists($func)) {
       // $product must be passed by reference.

=== modified file 'uc_cart/uc_cart.pages.inc'
--- uc_cart/uc_cart.pages.inc	2010-01-29 14:21:05 +0000
+++ uc_cart/uc_cart.pages.inc	2010-02-02 18:48:25 +0000
@@ -502,7 +502,7 @@
   $error = FALSE;
 
   // Invoke it on a per-module basis instead of all at once.
-  foreach (module_list() as $module) {
+  foreach (module_implements('order') as $module) {
     $function = $module .'_order';
     if (function_exists($function)) {
       // $order must be passed by reference.

=== modified file 'uc_cart_links/uc_cart_links.pages.inc'
--- uc_cart_links/uc_cart_links.pages.inc	2009-09-23 15:38:25 +0000
+++ uc_cart_links/uc_cart_links.pages.inc	2010-02-02 18:30:35 +0000
@@ -124,10 +124,10 @@
   if (variable_get('uc_cart_links_track', TRUE)) {
     $exists = db_result(db_query("SELECT clicks FROM {uc_cart_link_clicks} WHERE cart_link_id = '%s'", $id));
     if (intval($exists) == 0) {
-      db_query("INSERT INTO {uc_cart_link_clicks} (cart_link_id, clicks, last_click) VALUES ('%s', 1, %d)", $id, time());
+      db_query("INSERT INTO {uc_cart_link_clicks} (cart_link_id, clicks, last_click) VALUES ('%s', 1, %d)", $id, REQUEST_TIME);
     }
     else {
-      db_query("UPDATE {uc_cart_link_clicks} SET clicks = clicks + 1, last_click = %d WHERE cart_link_id = '%s'", time(), $id);
+      db_query("UPDATE {uc_cart_link_clicks} SET clicks = clicks + 1, last_click = %d WHERE cart_link_id = '%s'", REQUEST_TIME, $id);
     }
   }
 

=== modified file 'uc_file/uc_file.module'
--- uc_file/uc_file.module	2010-01-25 16:37:01 +0000
+++ uc_file/uc_file.module	2010-02-02 18:30:35 +0000
@@ -317,7 +317,7 @@
     // Either use the current expiration, or if there's none, start from right now.
     $new_expiration = _uc_file_expiration_date($download_modification, $download_modification['expiration']);
 
-    if ($new_expiration <= time()) {
+    if ($new_expiration <= REQUEST_TIME) {
       form_set_error('file_download]['. $key .'][time_quantity', t('The date %date has already occurred.', array('%date' => format_date($new_expiration, 'small'))));
     }
 
@@ -369,7 +369,7 @@
       'time_polarity' => '+',
       'time_quantity' => variable_get('uc_file_download_limit_duration_qty', NULL),
       'time_granularity' => variable_get('uc_file_download_limit_duration_granularity', 'never'),
-    ), time());
+    ), REQUEST_TIME);
 
     // Renew. (Explicit overwrite)
     uc_file_user_renew($fid, $account, NULL, $download_modification, TRUE);
@@ -1232,7 +1232,7 @@
   }
 
   if (!$timestamp) {
-    $timestamp = time();
+    $timestamp = REQUEST_TIME;
   }
 
   // Return the new expiration time.
@@ -1701,7 +1701,7 @@
     $key = NULL;
     if (!$file_user) {
       $file_user = array(
-        'granted' => time(),
+        'granted' => REQUEST_TIME,
         'accessed' => 0,
         'addresses' => array(),
       );

=== modified file 'uc_file/uc_file.pages.inc'
--- uc_file/uc_file.pages.inc	2010-01-22 22:00:37 +0000
+++ uc_file/uc_file.pages.inc	2010-02-02 19:19:42 +0000
@@ -105,7 +105,7 @@
     }
 
     // Expired.
-    elseif (time() > $file->expiration) {
+    elseif (REQUEST_TIME > $file->expiration) {
       $file_link = basename($file->filename);
     }
 
@@ -200,7 +200,7 @@
 
   // Must be a valid file.
   if (!$file_download || !is_file($file_download->full_path)) {
-    cache_set('uc_file_'. $ip, $requests, 'cache', time() + 86400);
+    cache_set('uc_file_'. $ip, $requests, 'cache', REQUEST_TIME + 86400);
     if ($requests == UC_FILE_REQUEST_LIMIT) {
       watchdog('uc_file', '%username has been temporarily banned from file downloads.', array('%username' => $message_user), WATCHDOG_WARNING);
     }
@@ -225,7 +225,7 @@
   }
 
   // Check if it's expired.
-  if ($file_download->expiration && time() >= $file_download->expiration) {
+  if ($file_download->expiration && REQUEST_TIME >= $file_download->expiration) {
     watchdog('uc_file', '%username has been denied an expired file download.', array('%username' => $message_user), WATCHDOG_WARNING);
 
     return UC_FILE_ERROR_EXPIRED;
@@ -305,23 +305,23 @@
 
   //Only send partial content header if downloading a piece of the file (IE workaround)
   if ($seek_start > 0 || $seek_end < ($size - 1)) {
-    drupal_set_header('HTTP/1.1 206 Partial Content');
+    drupal_set_header('206 Partial Content');
   }
 
   // Standard headers, including content-range and length
-  drupal_set_header('Pragma: public');
-  drupal_set_header('Cache-Control: cache, must-revalidate');
-  drupal_set_header('Accept-Ranges: bytes');
-  drupal_set_header('Content-Range: bytes '. $seek_start .'-'. $seek_end .'/'. $size);
-  drupal_set_header('Content-Type: '. $mimetype);
-  drupal_set_header('Content-Disposition: attachment; filename="'. $filename .'"');
-  drupal_set_header('Content-Length: '. ($seek_end - $seek_start + 1));
+  drupal_set_header('Pragma', 'public');
+  drupal_set_header('Cache-Control', 'cache, must-revalidate');
+  drupal_set_header('Accept-Ranges', 'bytes');
+  drupal_set_header('Content-Range', 'bytes ' . $seek_start . '-' . $seek_end . '/' . $size);
+  drupal_set_header('Content-Type', $mimetype);
+  drupal_set_header('Content-Disposition', 'attachment; filename="' . $filename . '"');
+  drupal_set_header('Content-Length', $seek_end - $seek_start + 1);
 
   // Last-Modified is required for content served dynamically
-  drupal_set_header('Last-Modified: '. gmdate("D, d M Y H:i:s", filemtime($file_user->full_path)) ." GMT");
+  drupal_set_header('Last-Modified', gmdate("D, d M Y H:i:s", filemtime($file_user->full_path)) ." GMT");
 
   // Etag header is required for Firefox3 and other managers
-  drupal_set_header('ETag: '. md5($file_user->full_path));
+  drupal_set_header('ETag', md5($file_user->full_path));
 
   // Open the file and seek to starting byte
   $fp = fopen($file_user->full_path, 'rb');
@@ -331,7 +331,7 @@
   while (!feof($fp)) {
 
     // Reset time limit for large files
-    set_time_limit(0);
+    drupal_set_time_limit(0);
 
     // Push the data to the client.
     print(fread($fp, UC_FILE_BYTE_SIZE));

=== modified file 'uc_order/uc_order.admin.inc'
--- uc_order/uc_order.admin.inc	2010-01-28 18:56:46 +0000
+++ uc_order/uc_order.admin.inc	2010-02-02 18:48:40 +0000
@@ -1177,7 +1177,7 @@
   $form['order_id'] = array('#type' => 'hidden', '#value' => $order->order_id);
   $form['order_uid'] = array('#type' => 'hidden', '#value' => $order->uid);
 
-  $modified = isset($form_state['post']['order_modified']) ? $form_state['post']['order_modified'] : time();
+  $modified = isset($form_state['post']['order_modified']) ? $form_state['post']['order_modified'] : REQUEST_TIME;
   $form['order_modified'] = array('#type' => 'hidden', '#value' => $modified);
 
   $panes = _order_pane_list('edit');
@@ -1365,7 +1365,7 @@
       $product->price = $product->sell_price;
       $product->data = module_invoke_all('add_to_cart_data', $form_state['values']);
 
-      foreach (module_list() as $module) {
+      foreach (module_implements('cart_item') as $module) {
         $function = $module .'_cart_item';
         if (function_exists($function)) {
           // $product must be passed by reference.

=== modified file 'uc_order/uc_order.module'
--- uc_order/uc_order.module	2009-11-18 22:20:31 +0000
+++ uc_order/uc_order.module	2010-02-02 18:49:36 +0000
@@ -879,7 +879,7 @@
 
   $form['search']['table9'] = array('#value' => '</td><td>');
 
-  $timestamp = arg(11) == 0 ? time() : arg(11);
+  $timestamp = arg(11) == 0 ? REQUEST_TIME : arg(11);
   $form['search']['start_date'] = array(
     '#type' => 'date',
     '#title' => t('Start date'),
@@ -888,7 +888,7 @@
 
   $form['search']['table10'] = array('#value' => '</td><td>');
 
-  $timestamp = arg(12) == 0 ? time() : arg(12);
+  $timestamp = arg(12) == 0 ? REQUEST_TIME : arg(12);
   $form['search']['end_date'] = array(
     '#type' => 'date',
     '#title' => t('End date'),
@@ -1015,7 +1015,7 @@
           ."billing_country, payment_method, data, created, modified) VALUES "
           ."(%d, '%s', 0, '%s', '', '', '', '', '', '', '', 0, '', 0, '', "
           ."'', '', '', '', '', '', 0, 0, 0, '', '', %d, %d)",
-           $uid, $order->order_status, $email, time(), time());
+           $uid, $order->order_status, $email, REQUEST_TIME, REQUEST_TIME);
   $order->order_id = db_last_insert_id('uc_orders', 'order_id');
 
   uc_order_module_invoke('new', $order, NULL);
@@ -1048,7 +1048,7 @@
            $order->billing_company, $order->billing_street1, $order->billing_street2,
            $order->billing_city, $order->billing_zone, $order->billing_postal_code,
            ((is_null($order->billing_country) || $order->billing_country == 0) ? variable_get('uc_store_country', 840) : $order->billing_country),
-           $order->payment_method, serialize($order->data), ip_address(), time(), $order->order_id);
+           $order->payment_method, serialize($order->data), ip_address(), REQUEST_TIME, $order->order_id);
 
   if (is_array($order->products)) {
     foreach ($order->products as $product) {
@@ -1188,10 +1188,10 @@
  */
 function uc_order_comment_save($order_id, $uid, $message, $type = 'admin', $status = 'pending', $notify = FALSE) {
   if ($type == 'admin') {
-    db_query("INSERT INTO {uc_order_admin_comments} (order_id, uid, message, created) VALUES (%d, %d, '%s', %d)", $order_id, $uid, $message, time());
+    db_query("INSERT INTO {uc_order_admin_comments} (order_id, uid, message, created) VALUES (%d, %d, '%s', %d)", $order_id, $uid, $message, REQUEST_TIME);
   }
   elseif ($type == 'order') {
-    db_query("INSERT INTO {uc_order_comments} (order_id, uid, message, order_status, notified, created) VALUES (%d, %d, '%s', '%s', %d, %d)", $order_id, $uid, $message, $status, $notify ? 1 : 0, time());
+    db_query("INSERT INTO {uc_order_comments} (order_id, uid, message, order_status, notified, created) VALUES (%d, %d, '%s', '%s', %d, %d)", $order_id, $uid, $message, $status, $notify ? 1 : 0, REQUEST_TIME);
   }
 }
 
@@ -1280,7 +1280,7 @@
   // Attempt the update if the order exists.
   if ($order !== FALSE) {
     // Return false if any module says the update is not good to go.
-    foreach (module_list() as $module) {
+    foreach (module_implements('order') as $module) {
       $function = $module .'_order';
       // $order must be passed by reference.
       if (function_exists($function) && ($return = $function('can_update', $order, $status))){
@@ -1293,7 +1293,7 @@
     }
 
     // Otherwise perform the update and log the changes.
-    db_query("UPDATE {uc_orders} SET order_status = '%s', modified = %d WHERE order_id = %d", $status, time(), $order_id);
+    db_query("UPDATE {uc_orders} SET order_status = '%s', modified = %d WHERE order_id = %d", $status, REQUEST_TIME, $order_id);
     uc_order_module_invoke('update', $order, $status);
 
     $change = array(t('Order status') => array('old' => uc_order_status_data($order->order_status, 'title'), 'new' => uc_order_status_data($status, 'title')));
@@ -1341,7 +1341,7 @@
   }
 
   db_query("INSERT INTO {uc_order_log} (order_id, uid, changes, created) VALUES (%d, %d, '%s', %d)",
-    $order_id, $user->uid, theme('item_list', $items), time());
+    $order_id, $user->uid, theme('item_list', $items), REQUEST_TIME);
 
   return TRUE;
 }
@@ -1382,7 +1382,7 @@
  * be passed by reference.
  */
 function uc_order_module_invoke($op, &$order, $edit) {
-  foreach (module_list() as $module) {
+  foreach (module_implements('order') as $module) {
     $function = $module .'_order';
     if (function_exists($function)) {
       $function($op, $order, $edit);
@@ -1443,7 +1443,7 @@
 
   $total += uc_line_items_calculate($order);
 
-  foreach (module_list() as $module) {
+  foreach (module_implements('order') as $module) {
     $function = $module .'_order';
     // $order must be passed by reference. Since hook_order() may be
     // unknowingly implemented (see date_order() in date_api.module), we verify
@@ -1487,7 +1487,7 @@
     }
 
     // See if any other modules have a say in the matter...
-    foreach (module_list() as $module) {
+    foreach (module_implements('cart_item') as $module) {
       $function = $module .'_cart_item';
       if (function_exists($function) && $function('can_ship', $product)) {
         // $product must be passed by reference.
@@ -1827,7 +1827,7 @@
       }
       else {
         // See if any modules have a say in this order's eligibility for deletion
-        foreach (module_list() as $module) {
+        foreach (module_implements('order') as $module) {
           $function = $module .'_order';
           // $order must be passed by reference.
           if (function_exists($function) && ($response = $function('can_delete', $order, NULL))) {

=== modified file 'uc_product/uc_product.module'
--- uc_product/uc_product.module	2010-01-25 16:37:01 +0000
+++ uc_product/uc_product.module	2010-02-02 18:30:35 +0000
@@ -638,7 +638,7 @@
  */
 function uc_product_insert($node) {
   if (!isset($node->unique_hash)) {
-    $node->unique_hash = md5($node->vid . $node->nid . $node->model . $node->list_price . $node->cost . $node->sell_price . $node->weight . $node->weight_units . $node->dim_length . $node->dim_width . $node->dim_height . $node->length_units . $node->pkg_qty . $node->default_qty . $node->shippable . time());
+    $node->unique_hash = md5($node->vid . $node->nid . $node->model . $node->list_price . $node->cost . $node->sell_price . $node->weight . $node->weight_units . $node->dim_length . $node->dim_width . $node->dim_height . $node->length_units . $node->pkg_qty . $node->default_qty . $node->shippable . REQUEST_TIME);
   }
   db_query("INSERT INTO {uc_products} (vid, nid, model, list_price, cost, sell_price, weight, weight_units, length, width, height, length_units, pkg_qty, default_qty, unique_hash, ordering, shippable) VALUES (%d, %d, '%s', %f, %f, %f, %f, '%s', %f, %f, %f, '%s', %d, %d, '%s', %d, %d)",
     $node->vid, $node->nid, $node->model, $node->list_price, $node->cost, $node->sell_price, $node->weight, $node->weight_units, $node->dim_length, $node->dim_width, $node->dim_height, $node->length_units, $node->pkg_qty, $node->default_qty, $node->unique_hash, $node->ordering, $node->shippable
@@ -1205,7 +1205,7 @@
     uc_cart_remove_item($nid, $cid, $data);
   }
   else {
-    db_query("UPDATE {uc_cart_products} SET qty = %d, changed = %d WHERE nid = %d AND cart_id = '%s' AND data = '%s'", $qty, time(), $nid, $cid, serialize($data));
+    db_query("UPDATE {uc_cart_products} SET qty = %d, changed = %d WHERE nid = %d AND cart_id = '%s' AND data = '%s'", $qty, REQUEST_TIME, $nid, $cid, serialize($data));
   }
 }
 

=== modified file 'uc_product_kit/uc_product_kit.module'
--- uc_product_kit/uc_product_kit.module	2010-01-25 16:37:01 +0000
+++ uc_product_kit/uc_product_kit.module	2010-02-02 18:49:47 +0000
@@ -208,7 +208,7 @@
   $obj->model = rtrim($obj->model, ' / ');
   db_query("INSERT INTO {uc_products} (vid, nid, model, list_price, cost, sell_price, weight, weight_units, default_qty, unique_hash, ordering, shippable) VALUES (%d, %d, '%s', %f, %f, %f, %f, '%s', %d, '%s', %d, %d)",
     $obj->vid, $obj->nid, $obj->model, $obj->list_price, $obj->cost, $obj->sell_price, $obj->weight, $obj->weight_units, $obj->default_qty,
-    md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . $obj->shippable . time()),
+    md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . $obj->shippable . REQUEST_TIME),
     $obj->ordering, $obj->shippable
   );
 }
@@ -332,7 +332,7 @@
   if ($node->revision) {
     db_query("INSERT INTO {uc_products} (vid, nid, model, list_price, cost, sell_price, weight, weight_units, default_qty, unique_hash, ordering, shippable) VALUES (%d, %d, '%s', %f, %f, %f, %f, '%s', %d, '%s', %d, %d)",
       $obj->vid, $obj->nid, $obj->model, $obj->list_price, $obj->cost, $obj->sell_price, $obj->weight, $obj->weight_units, $obj->default_qty,
-      md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . time()),
+      md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . REQUEST_TIME),
       $obj->ordering, $obj->shippable
     );
   }
@@ -342,7 +342,7 @@
     if (!db_affected_rows()) {
       db_query("INSERT INTO {uc_products} (vid, nid, model, list_price, cost, sell_price, weight, weight_units, default_qty, unique_hash, ordering, shippable) VALUES (%d, %d, '%s', %f, %f, %f, %f, '%s', %d, '%s', %d, %d)",
         $obj->vid, $obj->nid, $obj->model, $obj->list_price, $obj->cost, $obj->sell_price, $obj->weight, $obj->weight_units, $obj->default_qty,
-        md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . $obj->shippable . time()),
+        md5($obj->vid . $obj->nid . $obj->model . $obj->list_price . $obj->cost . $obj->sell_price . $obj->weight . $obj->weight_units . $obj->default_qty . $obj->ordering . $obj->shippable . REQUEST_TIME),
         $obj->ordering, $obj->shippable
       );
     }
@@ -1022,7 +1022,7 @@
     $kit_product->data['kit_id'] = $product->nid;
 
     // Run the product through the alter mill.
-    foreach (module_list() as $module) {
+    foreach (module_implements('cart_item') as $module) {
       $function = $module .'_cart_item';
       if (function_exists($function)) {
         // $product must be passed by reference.

=== modified file 'uc_reports/uc_reports.admin.inc'
--- uc_reports/uc_reports.admin.inc	2009-12-10 15:52:17 +0000
+++ uc_reports/uc_reports.admin.inc	2010-02-02 18:30:35 +0000
@@ -308,7 +308,7 @@
  */
 function uc_reports_products_custom() {
   $timezone = _uc_reports_timezone_offset();
-  $timezone_offset = time() + $timezone;
+  $timezone_offset = REQUEST_TIME + $timezone;
   $statistics = db_result(db_query("SELECT status FROM {system} WHERE name = 'statistics'"));
   $count_views = variable_get('statistics_count_content_views', FALSE);
   $page = (!is_null($_GET['page'])) ? intval($_GET['page']) : 0;
@@ -324,7 +324,7 @@
   if (arg(5) == '') {
     $args = array(
       'start_date' => gmmktime(0, 0, 0, gmdate('n', $timezone_offset), 1, gmdate('Y', $timezone_offset) - 1),
-      'end_date' => time(),
+      'end_date' => REQUEST_TIME,
       'status' => FALSE,
     );
   }
@@ -638,7 +638,7 @@
  * Display the sales summary report.
  */
 function uc_reports_sales_summary() {
-  $timezone_offset = time() + _uc_reports_timezone_offset();
+  $timezone_offset = REQUEST_TIME + _uc_reports_timezone_offset();
   $order_statuses = _uc_reports_order_statuses();
   $format = variable_get('uc_date_format_default', 'm/d/Y');
 
@@ -778,7 +778,7 @@
  * Display the yearly sales report form and table.
  */
 function uc_reports_sales_year() {
-  $timezone_offset = time() + _uc_reports_timezone_offset();
+  $timezone_offset = REQUEST_TIME + _uc_reports_timezone_offset();
   $order_statuses = _uc_reports_order_statuses();
 
   // Get the year for the report from the URL.
@@ -915,14 +915,14 @@
  */
 function uc_reports_sales_custom() {
   $timezone = _uc_reports_timezone_offset();
-  $timezone_offset = time() + $timezone;
+  $timezone_offset = REQUEST_TIME + $timezone;
   $format = variable_get('uc_date_format_default', 'm/d/Y');
 
   // Use default report parameters if we don't detect values in the URL.
   if (arg(5) == '') {
     $args = array(
       'start_date' => gmmktime(0, 0, 0, gmdate('n', $timezone_offset), 1, gmdate('Y', $timezone_offset) - 1),
-      'end_date' => time(),
+      'end_date' => REQUEST_TIME,
       'length' => 'month',
       'status' => FALSE,
       'detail' => FALSE,

=== modified file 'uc_reports/uc_reports.module'
--- uc_reports/uc_reports.module	2009-09-22 19:45:11 +0000
+++ uc_reports/uc_reports.module	2010-02-02 19:06:50 +0000
@@ -65,7 +65,7 @@
         break;
     }
     if (strpos($path, 'admin/store/reports/sales/year') === 0) {
-      $year = (is_null($_GET['year'])) ? format_date(time(), 'custom', "Y") : $_GET['year'];
+      $year = (is_null($_GET['year'])) ? format_date(REQUEST_TIME, 'custom', "Y") : $_GET['year'];
       $output .= t('This is the monthly break down of sales for the year @year. Clicking on each link will take you to a list of orders during that month.', array('@year' => $year));
     }
     $output .= '</p>';
@@ -228,7 +228,7 @@
     }
     $csv_output .= implode(',', $row) ."\n";
   }
-  cache_set('uc_reports_'. $report_id .'_'. $user_id, $csv_output, 'cache', time() + 86400);
+  cache_set('uc_reports_'. $report_id .'_'. $user_id, $csv_output, 'cache', REQUEST_TIME + 86400);
   return array('user' => $user_id, 'report' => $report_id, 'csv' => $csv_output);
 }
 
@@ -255,18 +255,18 @@
   else {
     ob_end_clean();
     $http_headers = array(
-      'Pragma: no-cache',
-      'Expires: 0',
-      'Cache-Control: no-cache, must-revalidate',
-      'Cache-Control: private',
-      'Content-Transfer-Encoding: binary',
-      'Content-Length:'. strlen($csv_data->data),
-      'Content-Disposition: attachment; filename="'. $report_id .'.csv"',
-      'Content-Type: text/csv'
+      'Pragma' => 'no-cache',
+      'Expires' => '0',
+      'Cache-Control' => 'no-cache, must-revalidate',
+      'Cache-Control' => 'private',
+      'Content-Transfer-Encoding' => 'binary',
+      'Content-Length' => strlen($csv_data->data),
+      'Content-Disposition' => 'attachment; filename="'. $report_id .'.csv"',
+      'Content-Type' => 'text/csv'
     );
-    foreach ($http_headers as $header) {
-      $header = preg_replace('/\r?\n(?!\t| )/', '', $header);
-      drupal_set_header($header);
+    foreach ($http_headers as $header => $value) {
+      $value = preg_replace('/\r?\n(?!\t| )/', '', $value);
+      drupal_set_header($header, $value);
     }
 
     print $csv_data->data;
@@ -383,7 +383,7 @@
  */
 function _uc_reports_end_interval($time, $interval = 'month') {
   if (empty($time)) {
-    $time = time();
+    $time = REQUEST_TIME;
   }
 
   $temp = strtotime('+1 '. $interval, $time) - 1;

=== modified file 'uc_roles/uc_roles.module'
--- uc_roles/uc_roles.module	2009-09-18 15:46:00 +0000
+++ uc_roles/uc_roles.module	2010-02-02 18:30:35 +0000
@@ -54,7 +54,7 @@
     }
 
     // Role expired.
-    elseif ($expiration->expiration <= time()) {
+    elseif ($expiration->expiration <= REQUEST_TIME) {
       uc_roles_revoke($account, $expiration->rid);
       ca_pull_trigger('uc_roles_notify_revoke', $account, $expiration);
     }
@@ -68,7 +68,7 @@
 
       // If we're past the expiration time minus the reminder time.
       $threshold = _uc_roles_get_expiration(-$reminder_qty, $reminder_granularity, $expiration->expiration);
-      if ($threshold <= time()) {
+      if ($threshold <= REQUEST_TIME) {
         ca_pull_trigger('uc_roles_notify_reminder', $account, $expiration);
         db_query("UPDATE {uc_roles_expirations} SET notified = 1 WHERE uid = %d AND rid = %d", $account->uid, $expiration->rid);
       }
@@ -423,7 +423,7 @@
     $qty *= $value['polarity'] == 'add' ? 1 : -1;
 
     $new_expiration = _uc_roles_get_expiration($qty, $value['granularity'], $value['expiration']);
-    if (time() > $new_expiration) {
+    if (REQUEST_TIME > $new_expiration) {
       form_set_error('qty', t("The new expiration date, %date, has already occurred.", array('%date' => format_date($new_expiration, 'small'))));
     }
   }
@@ -789,7 +789,7 @@
       $form_state['values']['uc_roles_expire_absolute']['year']
     );
 
-    if ($form_state['values']['uc_roles_expire_absolute'] <= time()) {
+    if ($form_state['values']['uc_roles_expire_absolute'] <= REQUEST_TIME) {
       form_set_error('uc_roles_expire_absolute', t('The specified date !date has already occurred. Please choose another.', array('!date' => format_date($form_state['values']['uc_roles_expire_absolute']))));
     }
   }
@@ -1375,7 +1375,7 @@
     return NULL;
   }
 
-  $start_time = (!is_null($start_time)) ? $start_time : time();
+  $start_time = (!is_null($start_time)) ? $start_time : REQUEST_TIME;
   $operator = ($duration < 0) ? '' : '+';
 
   return strtotime($operator . $duration .' '. $granularity, $start_time);

=== modified file 'uc_store/uc_store.module'
--- uc_store/uc_store.module	2010-02-01 16:13:44 +0000
+++ uc_store/uc_store.module	2010-02-02 18:30:35 +0000
@@ -579,7 +579,7 @@
   }
 
   // Save the timestamp of the last access.
-  // $_SESSION['uc_last_access'] = time();
+  // $_SESSION['uc_last_access'] = REQUEST_TIME;
 }
 
 /**

=== modified file 'uc_tax_report/uc_tax_report.module'
--- uc_tax_report/uc_tax_report.module	2009-07-24 17:06:02 +0000
+++ uc_tax_report/uc_tax_report.module	2010-02-02 18:30:35 +0000
@@ -28,14 +28,14 @@
  */
 function uc_tax_report_report_page($start_date = NULL, $end_date = NULL, $status = NULL) {
   $timezone = _uc_reports_timezone_offset();
-  $timezone_offset = time() + $timezone;
+  $timezone_offset = REQUEST_TIME + $timezone;
   $format = variable_get('uc_date_format_default', 'm/d/Y');
 
   // Use default report parameters if we don't detect values in the URL.
   if ($start_date == '') {
     $args = array(
       'start_date' => gmmktime(0, 0, 0, gmdate('n', $timezone_offset), 1, gmdate('Y', $timezone_offset) - 1),
-      'end_date' => time(),
+      'end_date' => REQUEST_TIME,
       'status' => FALSE,
     );
   }

