aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggTranslit.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-03-31 21:09:07 -0400
committerSteve Clay <steve@mrclay.org>2013-03-31 21:09:07 -0400
commit5ccc0540fd28cc1620ffca10e3aed92319e78794 (patch)
tree9f63ec4480036bdc988b66aaf479f9978c74dbe8 /engine/classes/ElggTranslit.php
parent835c7fe5eb77343081b9bd33ec465f9ce8929570 (diff)
downloadelgg-5ccc0540fd28cc1620ffca10e3aed92319e78794.tar.gz
elgg-5ccc0540fd28cc1620ffca10e3aed92319e78794.tar.bz2
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