--- C:/Documents and Settings/Aldo/Local Settings/Temp/TCVc68f.tmp/common.1.699.inc	Thu Oct 11 16:03:24 2007
+++ D:/drupal cvs/6.x/drupal/includes/common.inc	Thu Oct 11 16:01:42 2007
@@ -895,6 +895,41 @@
   return $output;
 }
 
+ /**
+ * Convert relative URLs in a block of HTML to absolute URLs.
+ *
+ * @param $html
+ *   A chunk of HTML.
+ * @param $base_document
+ *   Optional url to which the chunk of HTML is relative to.
+ * @return
+ *   The same HTML with URL in <... href=""> and  <... src=""> attributes
+ *   changed to absolute.
+ */
+function drupal_force_absolute_urls($html, $base_document = NULL) {
+  if(!isset($base_document)) {
+    global $base_url;
+    $base_document = $base_url;
+  }
+  $base_document_root = (preg_match('%(\w+://.*?)/%', $base_document, $matches)>0) ? $matches[1] : trim($base_document, '/');
+  $base_document = substr($base_document, 0, strrpos($base_document,'/'));
+
+  $src = array(
+    '/(\<[^\>]*? href| src)="(?!\w+:\/\/)([^\/][^"]*)"/i', 
+    '/(\<[^\>]*? href| src)="(?!\w+:\/\/)\/?([^"]*)"/i'
+  );
+  $dst = array(
+    '$1="'. $base_document .'/$2"',
+    '$1="'. $base_document_root .'/$2"'
+  );
+  $html = preg_replace($src, $dst, $html);
+
+  return $html;
+}
+
+/**
+
+
 /**
  * Format a single RSS item.
  *
@@ -904,7 +939,7 @@
   $output = "<item>\n";
   $output .= ' <title>'. check_plain($title) ."</title>\n";
   $output .= ' <link>'. check_url($link) ."</link>\n";
-  $output .= ' <description>'. check_plain($description) ."</description>\n";
+  $output .= ' <description>'. check_plain(drupal_force_absolute_urls($description, $link)) ."</description>\n";
   $output .= format_xml_elements($args);
   $output .= "</item>\n";
 
