diff options
author | Cash Costello <cash.costello@gmail.com> | 2013-04-13 05:59:29 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2013-04-13 05:59:29 -0700 |
commit | 46f4c707dc302979bf142c41b65546966287aa84 (patch) | |
tree | 8c7d50d67178bd8bce659cf3a73f989c33fea361 /engine/tests/regression | |
parent | c4a5b13569f9e3d41eb03ebf8e9b031719680453 (diff) | |
parent | 5ccc0540fd28cc1620ffca10e3aed92319e78794 (diff) | |
download | elgg-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/tests/regression')
-rw-r--r-- | engine/tests/regression/trac_bugs.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php index 691433a41..58444dd39 100644 --- a/engine/tests/regression/trac_bugs.php +++ b/engine/tests/regression/trac_bugs.php @@ -206,21 +206,23 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest { */ public function test_friendly_title() { $cases = array( + // acid test + "B&N > Amazon, OK? <bold> 'hey!' $34" + => "b-and-n-greater-than-amazon-ok-bold-hey-34", + // hyphen, underscore and ASCII whitespace replaced by separator, // other non-alphanumeric ASCII removed - "a-a_a a\na\ra\ta\va!a\"a#a\$a%a&a'a(a)a*a+a,a.a/a:a;a<a=a>a?a@a[a\\a]a^a`a{a|a}a~a" - => "a-a-a-a-a-a-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - + "a-a_a a\na\ra\ta\va!a\"a#a\$a%a&a'a(a)a*a+a,a.a/a:a;a=a?a@a[a\\a]a^a`a{a|a}a~a" + => "a-a-a-a-a-a-aaaaaaa-and-aaaaaaaaaaaaaaaaaaaaaaa", + // separators trimmed - "-_ hello _-" => "hello", + "-_ hello _-" + => "hello", // accents removed, lower case, other multibyte chars are URL encoded "I\xC3\xB1t\xC3\xABrn\xC3\xA2ti\xC3\xB4n\xC3\xA0liz\xC3\xA6ti\xC3\xB8n, AND \xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" // Iñtërnâtiônàlizætiøn, AND 日本語 => 'internationalizaetion-and-%E6%97%A5%E6%9C%AC%E8%AA%9E', - - // some HTML entity replacements - "Me & You" => 'me-and-you', ); // where available, string is converted to NFC before transliteration |