Skip to content
Snippets Groups Projects
Commit c58c876d authored by Greg Knaddison's avatar Greg Knaddison
Browse files

bug #326503 by johnpitcairn, DamienMcKenna: Remove leading and trailing...

bug #326503 by johnpitcairn, DamienMcKenna: Remove leading and trailing separators from strings and from around slashes
parent b74bf29f
No related branches found
Tags 6.x-1.2
No related merge requests found
......@@ -202,6 +202,9 @@ function pathauto_cleanstring($string, $clean_slash = TRUE) {
// Trim any leading or trailing separators (note the need to
$output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output);
// Replace trailing separators around slashes.
$output = preg_replace("/$seppattern\/|\/$seppattern/", "/", $output);
// Replace multiple separators with a single one
$output = preg_replace("/$seppattern+/", "$separator", $output);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment