Hi,
I'd like to suggest this patch to the path module that will help keep users from putting non-URL-like characters into URL aliases. I've had a bunch of users make pages with URL aliases like "This is my page", spaces and all. This patch makes the URL lower case, and converts all the non-URL-acceptable characters to a dash.
==========
--- path.module (revision 391)
+++ path.module (working copy)
@@ -88,6 +88,13 @@
function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '') {
$path = urldecode($path);
$alias = urldecode($alias);
+
+ $alias = preg_replace("|[^a-z0-9/\.]+|", "-", trim(strtolower($alias)));
+
+ if (substr($alias, 0, 1) == "/") {
+ $alias = substr($alias, 1);
+ }
+
// First we check if we deal with an existing alias and delete or modify it based on pid.
if ($pid) {
// An existing alias.
==========