From 102b6c2df377759de8b17f3fe6fa7366fb7385dd Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Apr 2015 02:40:33 +0200 Subject: [PATCH 1/5] [ticket/10922] Added support for body and subject in email BBCode PHPBB3-10922 --- phpBB/phpbb/textformatter/s9e/factory.php | 15 +++++++++++++-- .../tickets_data/PHPBB3-10922.html | 4 +++- .../text_processing/tickets_data/PHPBB3-10922.txt | 4 +++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index 9576abe1f0..a1bd43e40e 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -68,7 +68,7 @@ class factory implements \phpbb\textformatter\cache_interface 'b' => '[B]{TEXT}[/B]', 'code' => '[CODE]{TEXT}[/CODE]', 'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]', - 'email' => '[EMAIL={EMAIL;useContent}]{TEXT}[/EMAIL]', + 'email' => '[EMAIL={EMAIL;useContent} subject={TEXT;optional;postFilter=urlencode} body={TEXT;optional;postFilter=urlencode}]{TEXT}[/EMAIL]', 'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]', 'i' => '[I]{TEXT}[/I]', 'img' => '[IMG src={IMAGEURL;useContent}]', @@ -97,7 +97,18 @@ class factory implements \phpbb\textformatter\cache_interface 'img' => '{L_IMAGE}', 'size' => '', 'color' => '', - 'email' => '', + 'email' => ' + + mailto: + + + ? + subject= + &body= + + + + ', ); /** diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.html b/tests/text_processing/tickets_data/PHPBB3-10922.html index cdf8316df0..0c74809377 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.html +++ b/tests/text_processing/tickets_data/PHPBB3-10922.html @@ -1 +1,3 @@ -user@example.org... \ No newline at end of file +user@example.org
+...
+user@example.org
diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.txt b/tests/text_processing/tickets_data/PHPBB3-10922.txt index 348f8a1541..a8f09c40f2 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.txt +++ b/tests/text_processing/tickets_data/PHPBB3-10922.txt @@ -1 +1,3 @@ -[email]user@example.org[/email][email=user@example.org]...[/email] \ No newline at end of file +[email]user@example.org[/email] +[email=user@example.org]...[/email] +[email subject="Hello" body="Sent from phpBB"]user@example.org[/email] From 3f54fd49b5bf421852ceb2a54395d5ed353d2f29 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Apr 2015 02:53:40 +0200 Subject: [PATCH 2/5] [ticket/10922] Replaced urlencode() with rawurlencode() RFC-6068 asks for percent-encoding so that seems more correct. Not sure about that one. PHPBB3-10922 --- phpBB/phpbb/textformatter/s9e/factory.php | 2 +- tests/text_processing/tickets_data/PHPBB3-10922.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index a1bd43e40e..e07a1b52ca 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -68,7 +68,7 @@ class factory implements \phpbb\textformatter\cache_interface 'b' => '[B]{TEXT}[/B]', 'code' => '[CODE]{TEXT}[/CODE]', 'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]', - 'email' => '[EMAIL={EMAIL;useContent} subject={TEXT;optional;postFilter=urlencode} body={TEXT;optional;postFilter=urlencode}]{TEXT}[/EMAIL]', + 'email' => '[EMAIL={EMAIL;useContent} subject={TEXT;optional;postFilter=rawurlencode} body={TEXT;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]', 'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]', 'i' => '[I]{TEXT}[/I]', 'img' => '[IMG src={IMAGEURL;useContent}]', diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.html b/tests/text_processing/tickets_data/PHPBB3-10922.html index 0c74809377..6ca9eb0aa1 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.html +++ b/tests/text_processing/tickets_data/PHPBB3-10922.html @@ -1,3 +1,3 @@ user@example.org
...
-user@example.org
+user@example.org
From 6dc14f4cf0ce968315c9deb57c97a1eabb406dad Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Apr 2015 03:23:21 +0200 Subject: [PATCH 3/5] [ticket/10922] Added tests PHPBB3-10922 --- tests/text_processing/tickets_data/PHPBB3-10922.html | 2 ++ tests/text_processing/tickets_data/PHPBB3-10922.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.html b/tests/text_processing/tickets_data/PHPBB3-10922.html index 6ca9eb0aa1..7c375e79a6 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.html +++ b/tests/text_processing/tickets_data/PHPBB3-10922.html @@ -1,3 +1,5 @@ user@example.org
...
user@example.org
+user@example.org
+user@example.org
diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.txt b/tests/text_processing/tickets_data/PHPBB3-10922.txt index a8f09c40f2..7a0b245528 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.txt +++ b/tests/text_processing/tickets_data/PHPBB3-10922.txt @@ -1,3 +1,5 @@ [email]user@example.org[/email] [email=user@example.org]...[/email] [email subject="Hello" body="Sent from phpBB"]user@example.org[/email] +[email subject="Hi there"]user@example.org[/email] +[email body="Hi there"]user@example.org[/email] From d242610d0fa8ba1d5a462ebf084e834bb210934d Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Apr 2015 15:36:51 +0200 Subject: [PATCH 4/5] [ticket/10922] Added test data PHPBB3-10922 --- tests/text_processing/tickets_data/PHPBB3-10922.html | 5 ++++- tests/text_processing/tickets_data/PHPBB3-10922.txt | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.html b/tests/text_processing/tickets_data/PHPBB3-10922.html index 7c375e79a6..0fa80b9960 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.html +++ b/tests/text_processing/tickets_data/PHPBB3-10922.html @@ -1,5 +1,8 @@ user@example.org
...
-user@example.org
+...
user@example.org
user@example.org
+user@example.org
+user@example.org
+...
diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.txt b/tests/text_processing/tickets_data/PHPBB3-10922.txt index 7a0b245528..3db0786eca 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.txt +++ b/tests/text_processing/tickets_data/PHPBB3-10922.txt @@ -1,5 +1,8 @@ [email]user@example.org[/email] -[email=user@example.org]...[/email] -[email subject="Hello" body="Sent from phpBB"]user@example.org[/email] +[email=user@example.org ]...[/email] +[email=user@example.org subject="Hello"]...[/email] [email subject="Hi there"]user@example.org[/email] [email body="Hi there"]user@example.org[/email] +[email subject="Hello" body="Sent from phpBB"]user@example.org[/email] +[email body="Sent from phpBB" subject="Hello"]user@example.org[/email] +[email body="Sent from phpBB" subject="Hello" email="user@example.org"]...[/email] From 5c78be56ec0d32a7934bdfd83a4fb0242befc1fa Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Apr 2015 16:17:54 +0200 Subject: [PATCH 5/5] [ticket/10922] Added test PHPBB3-10922 --- tests/text_processing/tickets_data/PHPBB3-10922.html | 1 + tests/text_processing/tickets_data/PHPBB3-10922.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.html b/tests/text_processing/tickets_data/PHPBB3-10922.html index 0fa80b9960..3ff117f171 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.html +++ b/tests/text_processing/tickets_data/PHPBB3-10922.html @@ -1,5 +1,6 @@ user@example.org
...
+...
...
user@example.org
user@example.org
diff --git a/tests/text_processing/tickets_data/PHPBB3-10922.txt b/tests/text_processing/tickets_data/PHPBB3-10922.txt index 3db0786eca..e533ce6ed5 100644 --- a/tests/text_processing/tickets_data/PHPBB3-10922.txt +++ b/tests/text_processing/tickets_data/PHPBB3-10922.txt @@ -1,4 +1,5 @@ [email]user@example.org[/email] +[email=user@example.org]...[/email] [email=user@example.org ]...[/email] [email=user@example.org subject="Hello"]...[/email] [email subject="Hi there"]user@example.org[/email]