Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.382
diff -u -r1.382 aggregator.module
--- modules/aggregator/aggregator.module	5 Jul 2008 05:57:00 -0000	1.382
+++ modules/aggregator/aggregator.module	7 Jul 2008 22:03:46 -0000
@@ -604,9 +604,7 @@
         }
 
         if (!empty($image['LINK']) && !empty($image['URL']) && !empty($image['TITLE'])) {
-          // TODO: we should really use theme_image() here, but that only works with
-          // local images. It won't work with images fetched with a URL unless PHP version > 5.
-          $image = '<a href="' . check_url($image['LINK']) . '" class="feed-image"><img src="' . check_url($image['URL']) . '" alt="' . check_plain($image['TITLE']) . '" /></a>';
+        	$image = l(theme('image', $image['URL'], $image['TITLE']), $image['LINK'], array('html' => TRUE));
         }
         else {
           $image = NULL;
@@ -760,9 +758,9 @@
       }
     }
 
-    $timestamp = strtotime($date); // As of PHP 5.1.0, strtotime returns FALSE on failure instead of -1.
+    $timestamp = strtotime($date);
 
-    if ($timestamp <= 0) {
+    if ($timestamp === FALSE) {
       $timestamp = aggregator_parse_w3cdtf($date); // Aggregator_parse_w3cdtf() returns FALSE on failure.
       if (!$timestamp) {
         // Better than nothing.
Index: includes/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.inc,v
retrieving revision 1.95
diff -u -r1.95 database.inc
--- includes/database.inc	1 Jul 2008 20:36:40 -0000	1.95
+++ includes/database.inc	7 Jul 2008 22:03:42 -0000
@@ -338,18 +338,16 @@
       $n = strlen($matches[1]);
       $second_part = substr($query, $n);
       $first_part = substr($matches[1], 0, $n - 5) . " $join WHERE $where AND ( ";
-      // PHP 4 does not support strrpos for strings. We emulate it.
-      $haystack_reverse = strrev($second_part);
-      // No need to use strrev on the needle, we supply GROUP, ORDER, LIMIT
-      // reversed.
-      foreach (array('PUORG', 'REDRO', 'TIMIL') as $needle_reverse) {
-        $pos = strpos($haystack_reverse, $needle_reverse);
+
+      foreach (array('GROUP', 'ORDER', 'LIMIT') as $needle) {
+        $pos = strrpos($second_part, $needle);
         if ($pos !== FALSE) {
           // All needles are five characters long.
           $pos += 5;
           break;
         }
       }
+
       if ($pos === FALSE) {
         $query = $first_part . $second_part . ')';
       }
Index: includes/unicode.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/unicode.inc,v
retrieving revision 1.31
diff -u -r1.31 unicode.inc
--- includes/unicode.inc	18 Jun 2008 03:36:23 -0000	1.31
+++ includes/unicode.inc	7 Jul 2008 22:03:43 -0000
@@ -45,7 +45,7 @@
   // Check for outdated PCRE library
   // Note: we check if U+E2 is in the range U+E0 - U+E1. This test returns TRUE on old PCRE versions.
   if (preg_match('/[à-á]/u', 'â')) {
-    return array(UNICODE_ERROR, $t('The PCRE library in your PHP installation is outdated. This will cause problems when handling Unicode text. If you are running PHP 4.3.3 or higher, make sure you are using the PCRE library supplied by PHP. Please refer to the <a href="@url">PHP PCRE documentation</a> for more information.', array('@url' => 'http://www.php.net/pcre')));
+    return array(UNICODE_ERROR, $t('The PCRE library in your PHP installation is outdated. This will cause problems when handling Unicode text. Make sure you are using the PCRE library supplied by PHP. Please refer to the <a href="@url">PHP PCRE documentation</a> for more information.', array('@url' => 'http://www.php.net/pcre')));
   }
 
   // Check for mbstring extension
Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.11
diff -u -r1.11 openid.inc
--- modules/openid/openid.inc	26 May 2008 17:12:55 -0000	1.11
+++ modules/openid/openid.inc	7 Jul 2008 22:03:59 -0000
@@ -446,21 +446,3 @@
   }
   return $data;
 }
-
-/**
- * Provide bcpowmod support for PHP4.
- */
-if (!function_exists('bcpowmod')) {
-  function bcpowmod($base, $exp, $mod) {
-    $square = bcmod($base, $mod);
-    $result = 1;
-    while (bccomp($exp, 0) > 0) {
-      if (bcmod($exp, 2)) {
-        $result = bcmod(bcmul($result, $square), $mod);
-      }
-      $square = bcmod(bcmul($square, $square), $mod);
-      $exp = bcdiv($exp, 2);
-    }
-    return $result;
-  }
-}
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.642
diff -u -r1.642 comment.module
--- modules/comment/comment.module	3 Jul 2008 17:57:03 -0000	1.642
+++ modules/comment/comment.module	7 Jul 2008 22:03:50 -0000
@@ -1107,8 +1107,7 @@
   comment_invoke_comment($edit, 'validate');
 
   if (isset($edit['date'])) {
-    // As of PHP 5.1.0, strtotime returns FALSE upon failure instead of -1.
-    if (strtotime($edit['date']) <= 0) {
+    if (strtotime($edit['date']) === FALSE) {
       form_set_error('date', t('You have to specify a valid date.'));
     }
   }
Index: modules/update/update.fetch.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.fetch.inc,v
retrieving revision 1.9
diff -u -r1.9 update.fetch.inc
--- modules/update/update.fetch.inc	14 Apr 2008 17:48:43 -0000	1.9
+++ modules/update/update.fetch.inc	7 Jul 2008 22:04:00 -0000
@@ -47,8 +47,10 @@
   }
 
   if ($data) {
+  	var_dump($data);
     $parser = new update_xml_parser;
     $available = $parser->parse($data);
+    var_dump(simplexml_load_string($data));
   }
   if (!empty($available) && is_array($available)) {
     $frequency = variable_get('update_check_frequency', 1);
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.967
diff -u -r1.967 node.module
--- modules/node/node.module	26 May 2008 17:12:55 -0000	1.967
+++ modules/node/node.module	7 Jul 2008 22:03:59 -0000
@@ -828,8 +828,8 @@
       form_set_error('name', t('The username %name does not exist.', array('%name' => $node->name)));
     }
 
-    // Validate the "authored on" field. As of PHP 5.1.0, strtotime returns FALSE instead of -1 upon failure.
-    if (!empty($node->date) && strtotime($node->date) <= 0) {
+    // Validate the "authored on" field.
+    if (!empty($node->date) && strtotime($node->date) === FALSE) {
       form_set_error('date', t('You have to specify a valid date.'));
     }
   }
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.213
diff -u -r1.213 filter.module
--- modules/filter/filter.module	6 May 2008 12:18:47 -0000	1.213
+++ modules/filter/filter.module	7 Jul 2008 22:03:53 -0000
@@ -976,7 +976,7 @@
 /**
  * Processes an HTML tag.
  *
- * @param @m
+ * @param $m
  *   An array with various meaning depending on the value of $store.
  *   If $store is TRUE then the array contains the allowed tags.
  *   If $store is FALSE then the array has one element, the HTML tag to process.
@@ -1024,10 +1024,9 @@
   }
 
   // Is there a closing XHTML slash at the end of the attributes?
-  // In PHP 5.1.0+ we could count the changes, currently we need a separate match
-  $xhtml_slash = preg_match('%\s?/\s*$%', $attrlist) ? ' /' : '';
-  $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist);
-
+  $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist, -1, $count);
+  $xhtml_slash = $count ? ' /' : '';
+  
   // Clean up attributes
   $attr2 = implode(' ', _filter_xss_attributes($attrlist));
   $attr2 = preg_replace('/[<>]/', '', $attr2);
