diff -Nur pathfilter_drupal.org/class.pathparser.php pathfilter/class.pathparser.php
--- pathfilter_drupal.org/class.pathparser.php	1969-12-31 16:00:00.000000000 -0800
+++ pathfilter/class.pathparser.php	2007-05-30 16:49:11.152819000 -0700
@@ -0,0 +1,267 @@
+<?php
+/**
+ * PathParser 1.0
+ * Copyright (C) 2004 Carlos Reche 
+ *  @email:  carlosreche@yahoo.com
+ *  @url: http://www.phpclasses.org/browse/package/2040.html
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+class PathParser
+{
+    var $path;         // (string)  Parsed path
+
+    var $root;         // (string)  Path root ("http://www.something.com", "C:/" or "/")
+    var $dir;          // (string)  Path after root (only dirs)
+    var $file;         // (string)  File name, if path doesn't end on dir
+    var $extension;    // (string)  File extension
+
+    // If path is an URL
+    var $scheme;       // (string)  Ex. "http"
+    var $host;         // (string)  Ex. "www.something.com"
+    var $port;         // (int)     Host port
+    var $user;         // (string)  User
+    var $pass;         // (string)  Password
+    var $querystring;  // (string)  Query string (part after the "?")
+    var $fragment;     // (string)  Fragment (part after the "#")
+
+
+    function PathParser($path = "")
+    {
+        $this->path = $path;
+
+        $this->parse();
+    }
+
+
+
+
+
+    function parse($path = "")
+    {
+        $path = ($path != "")  ?  $path  :  $this->path;
+
+        $this->root        = "";
+        $this->dir         = "";
+        $this->file        = "";
+        $this->extension   = "";
+
+        $this->scheme      = "";
+        $this->host        = "";
+        $this->port        = "";
+        $this->user        = "";
+        $this->pass        = "";
+        $this->querystring = "";
+        $this->fragment    = "";
+
+
+        if ($path == "")
+        {
+            return false;
+        }
+
+
+        $this->path = $this->fix($path);
+
+        preg_match_all("/^(\\/|\w:\\/|(http|ftp)s?:\\/\\/[^\\/]+\\/)?(.*)$/i", $this->path, $matches, PREG_SET_ORDER);
+
+        $this->root = $matches[0][1];
+        $dir        = $matches[0][3];
+
+
+        if (preg_match("/\\/$/", $dir))
+        {
+            $this->dir = $dir;
+        }
+        else
+        {
+            $this->dir       = dirname($dir) . '/';
+            $this->file      = preg_replace("/^([^\\?]*)\\??([^\\#]*)\\#?(.*)$/", "\\1", basename($dir));
+            $this->extension = preg_replace("'^([^\\.]+\\.)+?([^\\.]+)$'", "\\2", $this->file);
+        }
+
+        if ($this->root == ""  ||  preg_match("/^(http|ftp|\\/)/", $this->root))
+        {
+            preg_match_all("/^([^\\?]*)\\??([^\\#]*)\\#?(.*)$/i", basename($dir), $matches, PREG_SET_ORDER);
+
+            $this->querystring = $matches[0][2];
+            $this->fragment    = $matches[0][3];
+
+            if (preg_match("/^(https?|ftp)/", $this->root))
+            {
+                $parse_url = parse_url($this->root);
+
+                $this->scheme = isset($parse_url['scheme'])  ?  $parse_url['scheme']  :  "";
+                $this->host   = isset($parse_url['host'])    ?  $parse_url['host']    :  "";
+                $this->port   = isset($parse_url['port'])    ?  $parse_url['port']    :  "";
+                $this->pass   = isset($parse_url['pass'])    ?  $parse_url['pass']    :  "";
+            }
+        }
+
+
+
+        return array(
+            'root'        => $this->root,
+            'dir'         => $this->dir,
+            'file'        => $this->file,
+            'extension'   => $this->extension,
+
+            'scheme'      => $this->scheme,
+            'host'        => $this->host,
+            'port'        => $this->port,
+            'user'        => $this->user,
+            'pass'        => $this->pass,
+            'querystring' => $this->querystring,
+            'fragment'    => $this->fragment,
+        );
+    }
+
+
+
+
+
+    function fix($path = "")
+    {
+        $path = ($path != "")  ?  $path  :  $this->path;
+
+        // Sanity check
+        if ($path == "")
+        {
+            return false;
+        }
+
+        // Converts all "\" to "/", and erases blank spaces at the beginning and the ending of the string
+        $path = trim(preg_replace("/\\\\/", "/", (string)$path));
+
+        /*  Checks if last parameter is a directory with no slashs ("/") in the end. To be considered a dir, 
+         *   it can't end on "dot something", or can't have a querystring ("dot something ? querystring")
+         */
+        if (!preg_match("/(\.\w{1,4})$/", $path)  &&  !preg_match("/\?[^\\/]+$/", $path)  &&  !preg_match("/\\/$/", $path))
+        {
+            $path .= '/';
+        }
+
+        /*   Breaks the original string in to parts: "root" and "dir".
+         *    "root" can be "C:/" (Windows), "/" (Linux) or "http://www.something.com/" (URLs). This will be the start of output string.
+         *    "dir" can be "Windows/System", "root/html/examples/", "includes/classes/class.validator.php", etc.
+         */
+        preg_match_all("/^(\\/|\w:\\/|(http|ftp)s?:\\/\\/[^\\/]+\\/)?(.*)$/i", $path, $matches, PREG_SET_ORDER);
+
+        $path_root = $matches[0][1];
+        $path_dir  = $matches[0][3];
+
+        /*  If "dir" part has one or more slashes at the beginning, erases all.
+         *   Then if it has one or more slashes in sequence, replaces for only 1.
+         */
+        $path_dir = preg_replace(  array("/^\\/+/", "/\\/+/"),  array("", "/"),  $path_dir  );
+
+        // Breaks "dir" part on each slash
+        $path_parts = explode("/", $path_dir);
+
+        // Creates a new array with the right path. Each element is a new dir (or file in the ending, if exists) in sequence.
+        for ($i = $j = 0, $real_path_parts = array(); $i < count($path_parts); $i++)
+        {
+            if ($path_parts[$i] == '.')
+            {
+                continue;
+            }
+            else if ($path_parts[$i] == '..')
+            {
+                if (  (isset($real_path_parts[$j-1])  &&  $real_path_parts[$j-1] != '..')  ||  ($path_root != "")  )
+                {
+                    array_pop($real_path_parts);
+                    $j--;
+                    continue;
+                }
+            }
+
+            array_push($real_path_parts, $path_parts[$i]);
+            $j++;
+        }
+
+        return $path_root . implode("/", $real_path_parts);
+    }
+
+
+
+
+
+    function findRelativePath($path_1, $path_2)
+    {
+        if ($path_1 == ""  ||  $path_2 == "")
+        {
+            return false;
+        }
+
+        $path_1 = $this->fix($path_1);
+        $path_2 = $this->fix($path_2);
+
+        preg_match_all("/^(\\/|\w:\\/|https?:\\/\\/[^\\/]+\\/)?(.*)$/i", $path_1, $matches_1, PREG_SET_ORDER);
+        preg_match_all("/^(\\/|\w:\\/|https?:\\/\\/[^\\/]+\\/)?(.*)$/i", $path_2, $matches_2, PREG_SET_ORDER);
+
+        if ($matches_1[0][1] != $matches_2[0][1])
+        {
+            return false;
+        }
+
+        $path_1_parts = explode("/", $matches_1[0][2]);
+        $path_2_parts = explode("/", $matches_2[0][2]);
+
+
+        while (isset($path_1_parts[0])  &&  isset($path_2_parts[0]))
+        {
+            if ($path_1_parts[0] != $path_2_parts[0])
+            {
+                break;
+            }
+
+            array_shift($path_1_parts);
+            array_shift($path_2_parts);
+        }
+
+
+        for ($i = 0, $path = ""; $i < count($path_1_parts)-1; $i++)
+        {
+            $path .= "../";
+        }
+
+        return $path . implode("/", $path_2_parts);
+    }
+
+
+
+
+
+    function parseQueryString($querystring = "")
+    {
+        $querystring = ($querystring != "")  ?  $querystring  :  $this->querystring;
+        $querystring = preg_replace("/^\\??/", "", $querystring);
+        $ampersand   = (preg_match("/&amp;/", $querystring))  ?  "&amp;"  :  "&";
+        $return      = array();
+
+        foreach (explode($ampersand, $querystring) as $definition)
+        {
+            $values = explode("=", $definition);
+            $return[$values[0]] = isset($values[1])  ?  $values[1]  :  "";
+        }
+
+        return $return;
+    }
+
+}
+
+
+
+?>
diff -Nur pathfilter_drupal.org/pathfilter.module pathfilter/pathfilter.module
--- pathfilter_drupal.org/pathfilter.module	2006-12-24 16:11:44.000000000 -0800
+++ pathfilter/pathfilter.module	2007-05-30 17:02:32.390648000 -0700
@@ -18,6 +18,8 @@
  *
  */
 
+include('class.pathparser.php');
+
 /**
  * Implementation of hook_filter_tips().
  */
@@ -93,5 +95,89 @@
     '#default_value' => variable_get('pathfilter_link_type', 'absolute'),
     '#description' => t('Should internal paths be transformed to absolute URLs, such as %absolute or relative paths, like %relative. Note that your changes may not appear until the cache has been cleared.', array('%absolute' => 'http://www.example.com/my-page', '%relative' => '/my-page')),
   );
+  $form['pathfilter']['pathfilter_process_all'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Enable automatic url processing for attributes.'),
+    '#default_value' => variable_get('pathfilter_process_all', 1),
+    '#description' => t('When this option is enabled, all %element_list elements will automatically have the servername and base path of their src, href, and action urls replaced with %internal. On editing of these elements, all instances of %internal will be replaced with the site\'s base path (%current_base_path).', array('%element_list' => '<img>, <a>, <script>, <object>, and <form>', '%internal' => '\'internal:\'', '%current_base_path' => base_path())),
+  );
   return $form;
-}
\ No newline at end of file
+}
+
+/**
+ * Modifies submitted node body values. Replaces base_path() in images, hrefs, 
+ * etc with 'internal:' on save. When editing a node, the body's 'internal:' 
+ * strings are replaced with 'base_path()'.
+ */
+function pathfilter_nodeapi( &$node, $op )
+{
+  switch ($op) {
+  case 'prepare':
+    if (variable_get('pathfilter_process_all', 1)) {
+      $node = (array) $node; //Cast to an array so we can walk it.
+      array_walk_recursive( $node, '_replace_internal' );
+      $node = (object) $node; //Cast it back to an object. Do we lose something here?
+    }
+    break;
+  case 'submit':
+    /* We do more when we look for what to replace with 'internal:'
+        - Only want to replace items that are links, not text or data
+        - Check to see if they specified the hostname of the server 
+        - Make sure to accept items that have multiple slashes.*/
+    if (variable_get('pathfilter_process_all', 1)) {
+      $node = (array) $node; //Cast to an array so we can walk it.
+      array_walk_recursive( $node, '_normalize_and_internalize' );
+      $node = (object) $node; //Cast it back to an object. Do we lose something here?
+    }
+    break;
+  }
+
+}
+
+/**
+ * Replaces the internal: in elements with the url for it
+ */
+function _replace_internal( &$item, $key ){
+  $absolute = (variable_get('pathfilter_link_type', 'absolute') == 'absolute' ? 'TRUE' : 'FALSE');
+  $item = preg_replace('/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e',
+    "'\"'. url('$1', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, $absolute) .'\"'", $item);
+}
+
+/**
+ * Normalizes and Internalizes all urls in a item, key 
+ */
+function _normalize_and_internalize( &$item, $key ) {
+  // First we find all of the items that look like they need to be replaced.
+  $pattern = '/(<img|<a|<script|<object|<form).*>/i';
+  preg_match_all( $pattern, $item, $matches );
+  // Then we normalize the links of the items that matched and do
+  // 'internal:' replacement.
+  foreach ( $matches[0] as $match ) {
+    preg_match( '/(src=|href=|action=)(\'|")([^\'"]*)(\'|"|>)/', $match, $url );
+    $PathParser = new PathParser( $url[3] );
+    $normalized_path = $PathParser->path;
+    // Do replacement with 'internal:' if needed 
+    $ir_re = _internal_replacement_re();
+    $normalized_path = preg_replace( $ir_re, 'internal:', $normalized_path );
+    // Update original string with changes
+    $item = preg_replace( '/(src=|href=|action=)(\'|")('.preg_quote($url[3], '/').')(\'|"|>)/', '$1$2'.$normalized_path.'$4', $item );
+  }
+}
+
+/**
+ * Generates the regular expression that will be used to find a url that should
+ * have 'internal:'.
+ */
+function _internal_replacement_re() {
+  static $ir_re;
+
+  if ($ir_re != '') {
+    return $ir_re;
+  }
+
+  global $base_url;
+  $base_path = base_path();
+
+  $ir_re = '/('.preg_quote(str_replace($base_path, '', $base_url.'/'), '/').')?'.preg_quote($base_path, '/').'/';
+  return $ir_re;
+}
