function trailing_slash_add in Trailing Slash 7
Function to add a trailing slash to a path if there isn't one already.
3 calls to trailing_slash_add()
- custom_url_rewrite_outbound in ./
trailing_slash.module - Implements custom_url_rewrite_outbound().
- trailing_slash_admin_paths_alter in ./
trailing_slash.module - Implements hook_admin_paths_alter().
- trailing_slash_url_outbound_alter in ./
trailing_slash.module - Implements hook_url_outbound_alter().
File
- ./
trailing_slash.module, line 11 - Adds checkbox to the Clean URLs settings form and alters outbound URLs.
Code
function trailing_slash_add(&$path) {
$path = preg_replace('/((?:^|\\/)[^\\/\\.]+?)$/isD', '$1/', $path);
}