mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-26 21:28:52 +00:00
Merge branch '3.2.x'
This commit is contained in:
commit
6ea9ed57b7
3 changed files with 63 additions and 34 deletions
|
@ -1740,3 +1740,47 @@ class bitfield
|
||||||
$this->data = $this->data | $bitfield->get_blob();
|
$this->data = $this->data | $bitfield->get_blob();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '')
|
||||||
|
{
|
||||||
|
if ($bbcode_status)
|
||||||
|
{
|
||||||
|
$quote_text = $text_formatter_utils->generate_quote(
|
||||||
|
censor_text($message_parser->message),
|
||||||
|
$quote_attributes
|
||||||
|
);
|
||||||
|
|
||||||
|
$message_parser->message = $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_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($message_link)
|
||||||
|
{
|
||||||
|
$message_parser->message = $message_link . $message_parser->message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -953,7 +953,16 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||||
$post_id = $request->variable('p', 0);
|
$post_id = $request->variable('p', 0);
|
||||||
if ($config['allow_post_links'])
|
if ($config['allow_post_links'])
|
||||||
{
|
{
|
||||||
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n";
|
$message_link = generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}";
|
||||||
|
$message_link_subject = "{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}";
|
||||||
|
if ($bbcode_status)
|
||||||
|
{
|
||||||
|
$message_link = "[url=" . $message_link . "]" . $message_link_subject . "[/url]\n\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message_link = $message_link . " - " . $message_link_subject . "\n\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -973,11 +982,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||||
{
|
{
|
||||||
$quote_attributes['post_id'] = $post['msg_id'];
|
$quote_attributes['post_id'] = $post['msg_id'];
|
||||||
}
|
}
|
||||||
$quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote(
|
|
||||||
censor_text($message_parser->message),
|
phpbb_format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link);
|
||||||
$quote_attributes
|
|
||||||
);
|
|
||||||
$message_parser->message = $message_link . $quote_text . "\n\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
|
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
|
||||||
|
|
|
@ -1627,35 +1627,14 @@ if ($generate_quote)
|
||||||
// Remove attachment bbcode tags from the quoted message to avoid mixing with the new post attachments if any
|
// Remove attachment bbcode tags from the quoted message to avoid mixing with the new post attachments if any
|
||||||
$message_parser->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#uis', '\\2', $message_parser->message);
|
$message_parser->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#uis', '\\2', $message_parser->message);
|
||||||
|
|
||||||
if ($config['allow_bbcode'])
|
$quote_attributes = array(
|
||||||
{
|
'author' => $post_data['quote_username'],
|
||||||
$message_parser->message = $bbcode_utils->generate_quote(
|
'post_id' => $post_data['post_id'],
|
||||||
censor_text($message_parser->message),
|
'time' => $post_data['post_time'],
|
||||||
array(
|
'user_id' => $post_data['poster_id'],
|
||||||
'author' => $post_data['quote_username'],
|
);
|
||||||
'post_id' => $post_data['post_id'],
|
|
||||||
'time' => $post_data['post_time'],
|
|
||||||
'user_id' => $post_data['poster_id'],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$message_parser->message .= "\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;
|
phpbb_format_quote($config['allow_bbcode'], $quote_attributes, $bbcode_utils, $message_parser);
|
||||||
$message = str_replace("\n", "\n" . $quote_string, $message);
|
|
||||||
$message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
|
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
|
||||||
|
|
Loading…
Add table
Reference in a new issue