aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-12-02 12:55:02 +0100
committerMarc Alexander <admin@m-a-styles.de>2018-12-02 19:50:09 +0100
commit087bf6fd35913152129eed97005953ac3979002a (patch)
treee3f7626a46a4819e4831fd46a84d88d76d3d7b76 /phpBB
parentfc27dc02b42e3afa98e96bdab0daf752c6cb9ccf (diff)
downloadforums-087bf6fd35913152129eed97005953ac3979002a.tar
forums-087bf6fd35913152129eed97005953ac3979002a.tar.gz
forums-087bf6fd35913152129eed97005953ac3979002a.tar.bz2
forums-087bf6fd35913152129eed97005953ac3979002a.tar.xz
forums-087bf6fd35913152129eed97005953ac3979002a.zip
[ticket/15893] Pass needed language class directly to format quote
PHPBB3-15893
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_content.php15
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php6
-rw-r--r--phpBB/posting.php5
3 files changed, 17 insertions, 9 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 8284aab6a4..a15a03f966 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1762,13 +1762,14 @@ class bitfield
/**
* Formats the quote according to the given BBCode status setting
*
- * @param bool $bbcode_status The status of the BBCode setting
- * @param array $quote_attributes The attributes of the quoted post
- * @param phpbb\textformatter\utils $text_formatter_utils Text formatter utilities
- * @param parse_message $message_parser Message parser class
- * @param string $message_link Link of the original quoted post
+ * @param phpbb\language\language $language Language class
+ * @param parse_message $message_parser Message parser class
+ * @param phpbb\textformatter\utils_interface $text_formatter_utils Text formatter utilities
+ * @param bool $bbcode_status The status of the BBCode setting
+ * @param array $quote_attributes The attributes of the quoted post
+ * @param string $message_link Link of the original quoted post
*/
-function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '')
+function phpbb_format_quote($language, $message_parser, $text_formatter_utils, $bbcode_status, $quote_attributes, $message_link = '')
{
if ($bbcode_status)
{
@@ -1794,7 +1795,7 @@ function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_u
$message = $quote_string . $message;
$message = str_replace("\n", "\n" . $quote_string, $message);
- $message_parser->message = $quote_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n";
+ $message_parser->message = $quote_attributes['author'] . " " . $language->lang('WROTE') . ":\n" . $message . "\n";
}
if ($message_link)
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index bc59d8ca86..b1b039add1 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -986,7 +986,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$quote_attributes['post_id'] = $post['msg_id'];
}
- phpbb_format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link);
+ /** @var \phpbb\language\language $language */
+ $language = $phpbb_container->get('language');
+ /** @var \phpbb\textformatter\utils_interface $text_formatter_utils */
+ $text_formatter_utils = $phpbb_container->get('text_formatter.utils');
+ phpbb_format_quote($language, $message_parser, $text_formatter_utils, $bbcode_status, $quote_attributes, $message_link);
}
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
diff --git a/phpBB/posting.php b/phpBB/posting.php
index e2329d610d..59be983987 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -846,6 +846,7 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_
load_drafts($topic_id, $forum_id);
}
+/** @var \phpbb\textformatter\utils_interface $bbcode_utils */
$bbcode_utils = $phpbb_container->get('text_formatter.utils');
if ($submit || $preview || $refresh)
@@ -1648,7 +1649,9 @@ if ($generate_quote)
'user_id' => $post_data['poster_id'],
);
- phpbb_format_quote($config['allow_bbcode'], $quote_attributes, $bbcode_utils, $message_parser);
+ /** @var \phpbb\language\language $language */
+ $language = $phpbb_container->get('language');
+ phpbb_format_quote($language, $message_parser, $bbcode_utils, $bbcode_status, $quote_attributes);
}
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)