aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/output.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-05 17:12:19 -0700
committerCash Costello <cash.costello@gmail.com>2012-07-05 17:12:19 -0700
commit35bd23ec8deb6c1f576780169bd0808caae4bdd1 (patch)
treed0c1f73dabf08333cd10e6a2d9384a39b40c36ba /engine/lib/output.php
parent34576a1f81d50a44064567469eb1406a028c92a7 (diff)
parent8a5ddacfa2598b8d984c2cdc6142d41936f38c48 (diff)
downloadelgg-35bd23ec8deb6c1f576780169bd0808caae4bdd1.tar.gz
elgg-35bd23ec8deb6c1f576780169bd0808caae4bdd1.tar.bz2
Merge pull request #281 from mrclay/2276-friendly-title
Fixes #2276: Better friendly titles
Diffstat (limited to 'engine/lib/output.php')
-rw-r--r--engine/lib/output.php18
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('&amp;', 'and', $title);
+
+ $title = ElggTranslit::urlize($title);
+
return $title;
}