function _pathfilter_process_files in Path Filter 7
Same name and namespace in other branches
- 5.2 pathfilter.module \_pathfilter_process_files()
- 5 pathfilter.module \_pathfilter_process_files()
- 6.2 pathfilter.module \_pathfilter_process_files()
- 6 pathfilter.module \_pathfilter_process_files()
1 call to _pathfilter_process_files()
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];
}