You are here

function _pathfilter_process_files in Path Filter 6.2

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

File

./pathfilter.module, line 158
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($format, $matches) {
  $absolute = variable_get('pathfilter_link_absolute_' . $format, 1) ? TRUE : FALSE;
  $link = file_create_url($matches[3]);
  $link = $absolute ? $link : substr($link, strlen($GLOBALS['base_url']));
  return $matches[1] . $link . $matches[1];
}