Index: DiffEngine.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/Attic/DiffEngine.php,v
retrieving revision 1.4.2.1.2.2
diff -u -p -r1.4.2.1.2.2 DiffEngine.php
--- DiffEngine.php	19 Nov 2009 15:40:33 -0000	1.4.2.1.2.2
+++ DiffEngine.php	15 Jun 2010 01:28:04 -0000
@@ -2,6 +2,7 @@
 // $Id: DiffEngine.php,v 1.4.2.1.2.2 2009/11/19 15:40:33 yhahn Exp $
 
 /**
+ * @file
  * A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)
  *
  * Copyright (C) 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org>
@@ -238,7 +239,7 @@ class _DiffEngine {
    * Returns the whole line if it's small enough, or the MD5 hash otherwise.
    */
   function _line_hash($line) {
-    if (strlen($line) > $this->MAX_XREF_LENGTH()) {
+    if (drupal_strlen($line) > $this->MAX_XREF_LENGTH()) {
       return md5( line);
     }
     else {
@@ -485,7 +486,7 @@ class _DiffEngine {
       while (++$i < $len && $changed[$i]) {
         continue;
       }
-      
+
       do {
         /*
          * Record the length of this run of changes, so that
@@ -774,7 +775,7 @@ class DiffFormatter {
    * Should a block header be shown?
    */
   var $show_header = TRUE;
-  
+
   /**
    * Number of leading context "lines" to preserve.
    *
@@ -986,7 +987,7 @@ class _HWLDF_WordAccumulator {
       }
       if ($word[0] == "\n") {
         $this->_flushLine($tag);
-        $word = substr($word, 1);
+        $word = drupal_substr($word, 1);
       }
       assert(!strstr($word, "\n"));
       $this->_group .= $word;
@@ -1030,7 +1031,7 @@ class WordLevelDiff extends MappedDiff {
         $words[] = "\n";
         $stripped[] = "\n";
       }
-      if ( strlen( $line ) > $this->MAX_LINE_LENGTH() ) {
+      if ( drupal_strlen( $line ) > $this->MAX_LINE_LENGTH() ) {
         $words[] = $line;
         $stripped[] = $line;
       }
Index: diff.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.module,v
retrieving revision 1.23.2.3.2.14
diff -u -p -r1.23.2.3.2.14 diff.module
--- diff.module	19 Nov 2009 15:31:26 -0000	1.23.2.3.2.14
+++ diff.module	15 Jun 2010 01:28:04 -0000
@@ -28,12 +28,12 @@ function diff_help($path, $arg) {
 }
 
 /**
- * Implementation of hook_menu()
+ * Implementation of hook_menu().
  */
 function diff_menu() {
   $items = array();
-  
-  /** 
+
+  /**
    * By using MENU_LOCAL_TASK (and 'tab_parent') we can get the various revision-views to
    * show the View|Edit|Revision-tabs of the node on top, and have the Revisions-tab open.
    * To avoid creating/showing any extra tabs or sub-tabs (tasks below top level) for the
@@ -43,7 +43,7 @@ function diff_menu() {
    * sharing a parent that can be accessed by its full path, it seems to work as desired.
    * Breadcrumbs work decently, at least the node link is among the crumbs. For some reason
    * any breadcrumbs "before/above" the node is only seen at 'node/%node/revisions/%/view'.
-   */ 
+   */
   $items['node/%node/revisions/list'] = array(
     // Not used directly, but was created to get the other menu items to work well
     'title' => 'List revisions',
@@ -170,7 +170,7 @@ function diff_nodeapi(&$node, $op, $teas
       // is actually an older revision to diff against.
       if ($old && !empty($_SESSION['diff_inline_highlight'])) {
         module_load_include('inc', 'diff', 'diff.pages');
-        $node->content['body']['#value'] = diff_inline_diff($node, $old);        
+        $node->content['body']['#value'] = diff_inline_diff($node, $old);
       }
     }
   }
Index: diff.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/Attic/diff.pages.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 diff.pages.inc
--- diff.pages.inc	20 Sep 2009 23:49:02 -0000	1.1.2.2
+++ diff.pages.inc	15 Jun 2010 01:28:04 -0000
@@ -1,10 +1,16 @@
 <?php
+// $Id$
+
+/**
+ * @file
+ * Menu callback for hook_menu().
+ */
 
 /**
  * Generate an overview table of older revisions of a node and provide
  * an input form to select two revisions for a comparison.
  */
-function diff_diffs_overview(&$node) {
+function diff_diffs_overview($node) {
   $output = '';
 
   drupal_set_title(t('Revisions for %title', array('%title' => $node->title)));
@@ -19,7 +25,7 @@ function diff_diffs_overview(&$node) {
  * @param $node
  *   Node whose revisions are displayed for selection.
  */
-function diff_node_revisions($form_state, &$node) {
+function diff_node_revisions($form_state, $node) {
   global $form_values;
   $form = array();
 
@@ -142,7 +148,7 @@ function diff_node_revisions_validate($f
  * @param $new_vid
  *   Version ID of the new revision.
  */
-function diff_diffs_show(&$node, $old_vid, $new_vid) {
+function diff_diffs_show($node, $old_vid, $new_vid) {
 
   // Set same title as on the 'Revisions' tab for consistency
   drupal_set_title(t('Revisions for %title', array('%title' => $node->title)));
@@ -231,7 +237,7 @@ function diff_diffs_show(&$node, $old_vi
  * @param $new_node
  *   Node for comparison which will be displayed on the right side.
  */
-function _diff_body_rows(&$old_node, &$new_node) {
+function _diff_body_rows($old_node, $new_node) {
   drupal_add_css(drupal_get_path('module', 'diff') .'/diff.css', 'module', 'all', FALSE);
   module_load_include('php', 'diff', 'DiffEngine');
   module_load_include('inc', 'diff', 'node');
@@ -244,7 +250,8 @@ function _diff_body_rows(&$old_node, &$n
 
   $rows = array();
   $any_visible_change = FALSE;
-  $node_diffs = module_invoke_all('diff', $old_node, $new_node);
+  // @todo quick workaround for PHP >= 5.3.0 date_diff() conflict.
+  $node_diffs = _diff_module_invoke_all($old_node, $new_node);
 
   // We start off assuming all form elements are in the correct order.
   $node_diffs['#sorted'] = TRUE;
@@ -308,6 +315,33 @@ function _diff_body_rows(&$old_node, &$n
 }
 
 /**
+ * Helper function to invoke hook_diff in all enabled modules that implement it.
+ *
+ * Don't use module_invoke_all() since if date.module is enabled will clash with
+ * PHP 5.3's date_diff() function.
+ *
+ * @todo figure out any else possible solution but not workaround.
+ * @link http://drupal.org/node/639320
+ * @see module_invoke_all()
+ */
+function _diff_module_invoke_all($old_node, $new_node) {
+  $return = array();
+  foreach (module_implements('diff') as $module) {
+    if ($module == 'date') {
+      continue; // Avoid function name collision with date_diff().
+    }
+    $result = module_invoke($module, 'diff', $old_node, $new_node);
+    if (isset($result) && is_array($result)) {
+      $return = array_merge_recursive($return, $result);
+    }
+    elseif (isset($result)) {
+      $return[] = $result;
+    }
+  }
+  return $return;
+}
+
+/**
  * Get the entry in the revisions list after $vid.
  * Returns FALSE if $vid is the last entry.
  *
@@ -316,7 +350,7 @@ function _diff_body_rows(&$old_node, &$n
  * @param $vid
  *   Version ID to look for.
  */
-function _diff_get_next_vid(&$node_revisions, $vid) {
+function _diff_get_next_vid($node_revisions, $vid) {
   $previous = NULL;
   foreach ($node_revisions as $revision) {
     if ($revision->vid == $vid) {
@@ -336,7 +370,7 @@ function _diff_get_next_vid(&$node_revis
  * @param $vid
  *   Version ID to look for.
  */
-function _diff_get_previous_vid(&$node_revisions, $vid) {
+function _diff_get_previous_vid($node_revisions, $vid) {
   $previous = NULL;
   foreach ($node_revisions as $revision) {
     if ($previous && $previous->vid == $vid) {
@@ -412,7 +446,7 @@ function diff_inline_diff($node, $target
         break;
       case 'delete':
         foreach ($chunk->orig as $i => $piece) {
-          if (strpos($piece, '<') === 0 && substr($piece, strlen($piece) - 1) === '>') {
+          if (strpos($piece, '<') === 0 && drupal_substr($piece, drupal_strlen($piece) - 1) === '>') {
             $output .= $piece;
           }
           else {
@@ -424,7 +458,7 @@ function diff_inline_diff($node, $target
         $chunk->closing = _diff_inline_process_chunk($chunk->closing);
 
         foreach ($chunk->closing as $i => $piece) {
-          if ($piece === ' ' || (strpos($piece, '<') === 0 && substr($piece, strlen($piece) - 1) === '>')) {
+          if ($piece === ' ' || (strpos($piece, '<') === 0 && drupal_substr($piece, drupal_strlen($piece) - 1) === '>')) {
             $output .= $piece;
           }
           else {
@@ -445,11 +479,11 @@ function _diff_inline_process_chunk($chu
   $j = 0;
   foreach ($chunk as $i => $piece) {
     $next = isset($chunk[$i+1]) ? $chunk[$i+1] : NULL;
-    if (strpos($piece, '<') === 0 && substr($piece, strlen($piece) - 1) === '>') {
+    if (strpos($piece, '<') === 0 && drupal_substr($piece, drupal_strlen($piece) - 1) === '>') {
       $processed[$j] = $piece;
       $j++;
     }
-    else if (isset($next) && strpos($next, '<') === 0 && substr($next, strlen($next) - 1) === '>') {
+    elseif (isset($next) && strpos($next, '<') === 0 && drupal_substr($next, drupal_strlen($next) - 1) === '>') {
       $processed[$j] .= $piece;
       $j++;
     }
Index: diff.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/Attic/diff.theme.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 diff.theme.inc
--- diff.theme.inc	13 Aug 2009 21:03:46 -0000	1.1.2.1
+++ diff.theme.inc	15 Jun 2010 01:28:04 -0000
@@ -1,4 +1,10 @@
 <?php
+// $Id$
+
+/**
+ * @file
+ * Themeable function callback for diff.module.
+ */
 
 /**
  * Theme function to display the revisions formular with means to select
Index: node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/node.inc,v
retrieving revision 1.2.2.1.2.1
diff -u -p -r1.2.2.1.2.1 node.inc
--- node.inc	8 Apr 2008 14:01:57 -0000	1.2.2.1.2.1
+++ node.inc	15 Jun 2010 01:28:04 -0000
@@ -2,10 +2,15 @@
 // $Id: node.inc,v 1.2.2.1.2.1 2008/04/08 14:01:57 weitzman Exp $
 
 /**
+ * @file
  * Implementation of hook_diff() for node.module (body and title).
  */
-function node_diff(&$old_node, &$new_node) {
-  
+
+/**
+ * Implementation of hook_diff() for node.module (body and title).
+ */
+function node_diff($old_node, $new_node) {
+
   $result = array();
   $type = node_get_types('type', $new_node);
   $result['title'] = array(
Index: taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/taxonomy.inc,v
retrieving revision 1.2.2.2.2.1
diff -u -p -r1.2.2.2.2.1 taxonomy.inc
--- taxonomy.inc	8 Apr 2008 14:01:57 -0000	1.2.2.2.2.1
+++ taxonomy.inc	15 Jun 2010 01:28:04 -0000
@@ -2,9 +2,14 @@
 // $Id: taxonomy.inc,v 1.2.2.2.2.1 2008/04/08 14:01:57 weitzman Exp $
 
 /**
+ * @file
  * Implementation of hook_diff() for taxonomy.
  */
-function taxonomy_diff(&$old_node, &$new_node) {
+
+/**
+ * Implementation of hook_diff() for taxonomy.
+ */
+function taxonomy_diff($old_node, $new_node) {
   $result = array();
   // TODO: make taxonomy by category not only by whole taxonomy?
   $old_taxonomy = array();
Index: upload.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/upload.inc,v
retrieving revision 1.3.2.1.2.1
diff -u -p -r1.3.2.1.2.1 upload.inc
--- upload.inc	8 Apr 2008 14:01:57 -0000	1.3.2.1.2.1
+++ upload.inc	15 Jun 2010 01:28:04 -0000
@@ -2,9 +2,14 @@
 // $Id: upload.inc,v 1.3.2.1.2.1 2008/04/08 14:01:57 weitzman Exp $
 
 /**
+ * @file
  * Implementation of hook_diff() for file attachments.
  */
-function upload_diff(&$old_node, &$new_node) {
+
+/**
+ * Implementation of hook_diff() for file attachments.
+ */
+function upload_diff($old_node, $new_node) {
   $result = array();
   $old_files = array();
   if (isset($old_node->files)) {
@@ -39,5 +44,5 @@ function upload_diff(&$old_node, &$new_n
       'show_header' => FALSE,
     )
   );
-  return $result; 
+  return $result;
 }
