diff options
author | MikelAlejoBR <mikelalejobr@outlook.com> | 2018-07-22 17:08:35 +0200 |
---|---|---|
committer | MikelAlejoBR <mikelalejobr@outlook.com> | 2018-07-22 17:09:09 +0200 |
commit | 12fdfe145af65b26b42a6a9a18134f748264e04d (patch) | |
tree | e4c11e4d098002fe2eb6dc38b3661fdc117f3200 /phpBB/includes/ucp/ucp_pm_compose.php | |
parent | 04899d1efd261493111e309600531d363b73bc46 (diff) | |
download | forums-12fdfe145af65b26b42a6a9a18134f748264e04d.tar forums-12fdfe145af65b26b42a6a9a18134f748264e04d.tar.gz forums-12fdfe145af65b26b42a6a9a18134f748264e04d.tar.bz2 forums-12fdfe145af65b26b42a6a9a18134f748264e04d.tar.xz forums-12fdfe145af65b26b42a6a9a18134f748264e04d.zip |
[ticket/15622] Fix quoting in PMs when BBCodes are disabled
Before parsing the private message to be loaded a simple BBCode status
check is done to verify that BBCodes are enabled. Depending on that
option the quote will be formated as BBCode or as plain text, similarly
to what is done in posting.php.
PHPBB3-15622
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index bf18e76568..e108356584 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -978,7 +978,26 @@ function compose_pm($id, $mode, $action, $user_folders = array()) censor_text($message_parser->message), $quote_attributes ); - $message_parser->message = $message_link . $quote_text . "\n\n"; + if ($bbcode_status) + { + $message_parser->message = $message_link . $quote_text . "\n\n"; + } + else + { + $offset = 0; + $quote_string = "> "; + $message = censor_text(trim($message_parser->message)); + // see if we are nesting. It's easily tricked but should work for one level of nesting + if (strpos($message, ">") !== false) + { + $offset = 10; + } + $message = utf8_wordwrap($message, 75 + $offset, "\n"); + + $message = $quote_string . $message; + $message = str_replace("\n", "\n" . $quote_string, $message); + $message_parser->message = $quote_username . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; + } } if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) |