Index: pathfilter.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathfilter/pathfilter.module,v retrieving revision 1.5.2.1 diff -u -r1.5.2.1 pathfilter.module --- pathfilter.module 25 Dec 2006 00:11:44 -0000 1.5.2.1 +++ pathfilter.module 18 Apr 2007 17:52:25 -0000 @@ -38,6 +38,7 @@ * Implementation of hook_filter(). */ function pathfilter_filter($op, $delta = 0, $format = -1, $text = '') { + // The "list" operation provides the module an opportunity to declare both how // many filters it defines and a human-readable name for each filter. Note that // the returned name should be passed through t() for translation. @@ -64,8 +65,15 @@ // returned, once any necessary substitutions have taken place. case 'process': $absolute = (variable_get('pathfilter_link_type', 'absolute') == 'absolute' ? 'TRUE' : 'FALSE'); - return preg_replace('/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e', - "'\"'. url('$1', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, ". $absolute .") .'\"'", $text); + $patterns = array( + '/"internal:([^"#\?]+)\??([^"#]+)?#?([^"]+)?"/e', + '/"files:([\/\w.-]+)"/e' + ); + $replacement = array( + "'\"'. url('$1', '$2' ? '$2' : NULL, '$3' ? '$3' : NULL, ". $absolute .") .'\"'", + "'\"'. base_path() . file_directory_path() .'/$1\"'" + ); + return preg_replace( $patterns, $replacement, $text ); // Filter settings for pathfilter. case 'settings': @@ -94,4 +102,4 @@ '#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')), ); return $form; -} \ No newline at end of file +}