hyphens instead of underscores

This commit is contained in:
JT Smith 2005-04-01 05:21:00 +00:00
parent 2c145c0d22
commit c23e22a3b4
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,9 @@
- fix [ 1173101 ] Template in ^LoginToggle();
- Added a page to the help docs which tells you what Assets are enabled for this site.
- Added a new Error Handling / Logging mechanism.
- Whitespace in URLs will now be replaced with hyphens (-) instead of
underscores (_) because there is some evidence that hyphens get better
search index ranking than underscores.
6.5.5

View file

@ -13,7 +13,7 @@ sub makeUrlCompliant {
$value =~ s/\s+$//; #removes trailing whitespace
$value =~ s/^\s+//; #removes leading whitespace
$value =~ s/^\\//; #removes leading slash
$value =~ s/ /_/g; #replaces whitespace with underscores
$value =~ s/ /-/g; #replaces whitespace with hyphens
$value =~ s/\.$//; #removes trailing period
$value =~ s/[^A-Za-z0-9\-\.\_\/]//g; #removes all funky characters
$value =~ s/^\///; #removes a preceeding /