mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[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
This commit is contained in:
@@ -147,6 +147,21 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
|
||||
array('author' => "\\\"'"),
|
||||
'[quote="\\\\\\"\'"]...[/quote]',
|
||||
),
|
||||
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(
|
||||
|
Reference in New Issue
Block a user