Index: cdn.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cdn/cdn.module,v
retrieving revision 1.75
diff -u -F '^f' -r1.75 cdn.module
--- cdn.module	13 Nov 2010 10:26:02 -0000	1.75
+++ cdn.module	18 Nov 2010 00:05:04 -0000
@@ -235,6 +235,25 @@ function cdn_form_system_performance_set
 }
 
 /**
+ * Implementation of hook_nodeapi().
+ */
+function cdn_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+  // We implement hook_nodeapi() for $op == 'alter', to alter the final HTML,
+  // to ensure that all file URLs (notably for images) in nodes also point to
+  // the CDN.
+  if ($op == 'alter') {
+    cdn_load_include('fallback');
+    if (isset($node->body)) {
+      cdn_html_alter_image_urls($node->body);
+    }
+    else if (isset($node->teaser)) {
+      cdn_html_alter_image_urls($node->teaser);
+    }
+  }
+}
+
+
+/**
  * Implementation of hook_theme().
  */
 function cdn_theme() {
