aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/output.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-02-25 17:54:15 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-02-25 17:54:15 -0800
commitd62d625541025dc7ca8ab75d138339442a96f4ba (patch)
treefbc5d2a7dfcbb77dbeda7706db854b1fd5e7e119 /engine/lib/output.php
parent217e79eaeb51587943376f0a1bfc68c3586af46e (diff)
downloadelgg-d62d625541025dc7ca8ab75d138339442a96f4ba.tar.gz
elgg-d62d625541025dc7ca8ab75d138339442a96f4ba.tar.bz2
Fixes #3210. Keeping -s in URL friendly titles.
Diffstat (limited to 'engine/lib/output.php')
-rw-r--r--engine/lib/output.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php
index b96cf354c..b1245a924 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -310,15 +310,19 @@ function elgg_get_friendly_title($title) {
return $result;
}
+ // @todo not using this because of locale concerns
//$title = iconv('UTF-8', 'ASCII//TRANSLIT', $title);
+ // @todo this uses a utf8 character class. can use if
+ // we want to support utf8 in the url.
+ //$title = preg_replace('/[^\p{L}\- ]/u', '', $title);
+
// use A-Za-z0-9_ instead of \w because \w is locale sensitive
- $title = preg_replace("/[^A-Za-z0-9_ ]/", "", $title);
- $title = preg_replace("/[^\w ]/", "", $title);
+ $title = preg_replace("/[^A-Za-z0-9_\- ]/", "", $title);
$title = str_replace(" ", "-", $title);
$title = str_replace("--", "-", $title);
$title = trim($title);
- $title = strtolower($title);
+ $title = elgg_strtolower($title);
return $title;
}