aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggTranslit.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-04-13 05:59:29 -0700
committerCash Costello <cash.costello@gmail.com>2013-04-13 05:59:29 -0700
commit46f4c707dc302979bf142c41b65546966287aa84 (patch)
tree8c7d50d67178bd8bce659cf3a73f989c33fea361 /engine/classes/ElggTranslit.php
parentc4a5b13569f9e3d41eb03ebf8e9b031719680453 (diff)
parent5ccc0540fd28cc1620ffca10e3aed92319e78794 (diff)
downloadelgg-46f4c707dc302979bf142c41b65546966287aa84.tar.gz
elgg-46f4c707dc302979bf142c41b65546966287aa84.tar.bz2
Merge pull request #5310 from mrclay/4972
Fixes #4972: More robust friendly titles implementation
Diffstat (limited to 'engine/classes/ElggTranslit.php')
-rw-r--r--engine/classes/ElggTranslit.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/engine/classes/ElggTranslit.php b/engine/classes/ElggTranslit.php
index 601965c11..4ae1d2479 100644
--- a/engine/classes/ElggTranslit.php
+++ b/engine/classes/ElggTranslit.php
@@ -49,10 +49,19 @@ class ElggTranslit {
// Internationalization, AND 日本語!
$string = self::transliterateAscii($string);
- // more translation
+ // allow HTML tags in titles
+ $string = preg_replace('~<([a-zA-Z][^>]*)>~', ' $1 ', $string);
+
+ // more substitutions
+ // @todo put these somewhere else
$string = strtr($string, array(
- // Euro/GBP
- "\xE2\x82\xAC" /* € */ => 'E', "\xC2\xA3" /* £ */ => 'GBP',
+ // currency
+ "\xE2\x82\xAC" /* € */ => ' E ',
+ "\xC2\xA3" /* £ */ => ' GBP ',
+
+ "&" => ' and ',
+ ">" => ' greater than ',
+ "<" => ' less than ',
));
// remove all ASCII except 0-9a-zA-Z, hyphen, underscore, and whitespace