You are here

function _pathfilter_process_files in Path Filter 7

Same name and namespace in other branches
  1. 5.2 pathfilter.module \_pathfilter_process_files()
  2. 5 pathfilter.module \_pathfilter_process_files()
  3. 6.2 pathfilter.module \_pathfilter_process_files()
  4. 6 pathfilter.module \_pathfilter_process_files()
1 call to _pathfilter_process_files()
_pathfilter_process_handler in ./pathfilter.module

File

./pathfilter.module, line 137
This filter takes internal Drupal paths in double quotes, written as e.g. "internal:node/99", and replaces them with the appropriate absolute http URL using Drupal's url() function [1]. E.g. for a site located at http://example.com/mysite

Code

function _pathfilter_process_files($settings, $matches) {
  $absolute = $settings['link_absolute'];
  $link = file_create_url($matches[3]);
  $link = $absolute ? $link : substr($link, strlen($GLOBALS['base_url']));
  return $matches[1] . $link . $matches[1];
}