diff options
author | Steve Clay <steve@mrclay.org> | 2012-06-25 01:25:46 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-06-26 10:25:50 -0400 |
commit | 4fff20a33467a7318956412d4dabfcab1ce6daba (patch) | |
tree | b9b2a9d43c01e094cff258f9b4720a663123f0eb /engine/lib | |
parent | d71309056037adc869319566f9ec53313eb192d8 (diff) | |
download | elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.gz elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.bz2 |
Fixes #2276: Better friendly titles, portable ElggTranslit class, better units
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/output.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php index b1245a924..7bfc4be6e 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -310,19 +310,11 @@ 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 = str_replace(" ", "-", $title); - $title = str_replace("--", "-", $title); - $title = trim($title); - $title = elgg_strtolower($title); + // handle some special cases + $title = str_replace('&', 'and', $title); + + $title = ElggTranslit::urlize($title); + return $title; } |