From 0ef920eb427203e27cb56c19d2a6894ba79786c4 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Sat, 26 Apr 2014 15:01:30 +0200 Subject: [PATCH 1/4] [ticket/12025] Post Preview no longer shows warnings https://tracker.phpbb.com/browse/PHPBB3-12025 PHPBB3-12025 --- phpBB/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index ed1268e84b..975f4bd079 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -882,7 +882,7 @@ if ($submit || $preview || $refresh) $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); // On a refresh we do not care about message parsing errors - if (sizeof($message_parser->warn_msg) && $refresh) + if (sizeof($message_parser->warn_msg) && $refresh && !$preview) { $message_parser->warn_msg = array(); } From 8facf2b8d9980ef92ad519ebf004e1bdc1c4d287 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Sun, 27 Apr 2014 23:11:10 +0200 Subject: [PATCH 2/4] [ticket/12025] Don't show any error on preview if the message is empty PHPBB3-12025 --- phpBB/posting.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index 975f4bd079..47b366fce0 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -879,7 +879,10 @@ if ($submit || $preview || $refresh) $message_parser->warn_msg = array(); } - $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); + if ($preview && empty($message_parser->message)) + { + $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); + } // On a refresh we do not care about message parsing errors if (sizeof($message_parser->warn_msg) && $refresh && !$preview) From 7af9f41e4f2a179065ce42dfb0755ecf3459add7 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Mon, 28 Apr 2014 21:18:01 +0200 Subject: [PATCH 3/4] [ticket/12025] Fixing the condition.... PHPBB3-12025 --- phpBB/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index 47b366fce0..9a3df73701 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -879,7 +879,7 @@ if ($submit || $preview || $refresh) $message_parser->warn_msg = array(); } - if ($preview && empty($message_parser->message)) + if (! ($preview && empty($message_parser->message))) { $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); } From 00610677152f073c4cded21a24f5ce92bbb39b8c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 5 May 2014 18:23:55 +0200 Subject: [PATCH 4/4] [ticket/12025] Apply DeMorgan PHPBB3-12025 --- phpBB/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index 9a3df73701..89056f0f11 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -879,7 +879,7 @@ if ($submit || $preview || $refresh) $message_parser->warn_msg = array(); } - if (! ($preview && empty($message_parser->message))) + if (!$preview || !empty($message_parser->message)) { $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); }