aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 74fec6712..7b05ca9f6 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -648,7 +648,19 @@
}
-
+ /**
+ * When given a title, returns a version suitable for inclusion in a URL
+ *
+ * @param string $title The title
+ * @return string The optimised title
+ */
+ function friendly_title($title) {
+ $title = trim($title);
+ $title = strtolower($title);
+ $title = preg_replace("/[^\w ]/","",$title);
+ $title = str_replace(" ","-",$title);
+ return $title;
+ }
/**
* Library loading and handling