aboutsummaryrefslogtreecommitdiffstats
path: root/tests/text_formatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-19 23:10:35 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-25 21:33:17 +0200
commite50d9186ce15367e8f6e2aab5c04481ca0046ec6 (patch)
tree74517e839b1073df794de1e1b9434c13428b6f59 /tests/text_formatter
parent8a077e0e943d87ee1d26b0501f0b9bcc472ab904 (diff)
downloadforums-e50d9186ce15367e8f6e2aab5c04481ca0046ec6.tar
forums-e50d9186ce15367e8f6e2aab5c04481ca0046ec6.tar.gz
forums-e50d9186ce15367e8f6e2aab5c04481ca0046ec6.tar.bz2
forums-e50d9186ce15367e8f6e2aab5c04481ca0046ec6.tar.xz
forums-e50d9186ce15367e8f6e2aab5c04481ca0046ec6.zip
[ticket/13847] Changed enquote() logic to use whichever is the shortest
Will enclose attribute values in single- or double- quotes depending on whichever requires the least escaping. Characters that need to be escaped are always escaped regardless. PHPBB3-13847
Diffstat (limited to 'tests/text_formatter')
-rw-r--r--tests/text_formatter/s9e/utils_test.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php
index 3c92965b49..555f29cb38 100644
--- a/tests/text_formatter/s9e/utils_test.php
+++ b/tests/text_formatter/s9e/utils_test.php
@@ -149,6 +149,21 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
),
array(
'...',
+ array('author' => 'Lots of doubles """ one single \' one backslash \\'),
+ '[quote=\'Lots of doubles """ one single \\\' one backslash \\\\\']...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => "Lots of singles ''' one double \" one backslash \\"),
+ '[quote="Lots of singles \'\'\' one double \\" one backslash \\\\"]...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => 'Defaults to doublequotes """\'\'\''),
+ '[quote="Defaults to doublequotes \\"\\"\\"\'\'\'"]...[/quote]',
+ ),
+ array(
+ '...',
array(
'author' => 'user',
'post_id' => 123,