aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter
diff options
context:
space:
mode:
author3D-I <480857+3D-I@users.noreply.github.com>2019-12-05 23:41:44 +0100
committer3D-I <480857+3D-I@users.noreply.github.com>2019-12-05 23:42:12 +0100
commite6c45623eaa5023d6372303158aa976a7e945626 (patch)
tree875f3860d397ddae4bb37b871ec2bd4e4c73a2a9 /phpBB/phpbb/textformatter
parent8c42a9d9000ff06d4ea10ab04e47ab2a998e260a (diff)
downloadforums-e6c45623eaa5023d6372303158aa976a7e945626.tar
forums-e6c45623eaa5023d6372303158aa976a7e945626.tar.gz
forums-e6c45623eaa5023d6372303158aa976a7e945626.tar.bz2
forums-e6c45623eaa5023d6372303158aa976a7e945626.tar.xz
forums-e6c45623eaa5023d6372303158aa976a7e945626.zip
[ticket/16247] Quote PM has no identifier
Code review PHPBB3-16247
Diffstat (limited to 'phpBB/phpbb/textformatter')
-rw-r--r--phpBB/phpbb/textformatter/s9e/quote_helper.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/quote_helper.php b/phpBB/phpbb/textformatter/s9e/quote_helper.php
index dc01883c43..3011ec88dc 100644
--- a/phpBB/phpbb/textformatter/s9e/quote_helper.php
+++ b/phpBB/phpbb/textformatter/s9e/quote_helper.php
@@ -21,6 +21,11 @@ class quote_helper
protected $post_url;
/**
+ * @var string Base URL for a private message link, uses {MSG_ID} as placeholder
+ */
+ protected $msg_url;
+
+ /**
* @var string Base URL for a profile link, uses {USER_ID} as placeholder
*/
protected $profile_url;
@@ -53,31 +58,26 @@ class quote_helper
*/
public function inject_metadata($xml)
{
- $post_url = $this->post_url;
- $msg_url = $this->msg_url;
- $profile_url = $this->profile_url;
- $user = $this->user;
-
return \s9e\TextFormatter\Utils::replaceAttributes(
$xml,
'QUOTE',
- function ($attributes) use ($post_url, $profile_url, $user)
+ function ($attributes)
{
if (isset($attributes['post_id']))
{
- $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $post_url);
+ $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $this->post_url);
}
if (isset($attributes['msg_id']))
{
- $attributes['msg_url'] = str_replace('{MSG_ID}', $attributes['msg_id'], $msg_url);
+ $attributes['msg_url'] = str_replace('{MSG_ID}', $attributes['msg_id'], $this->msg_url);
}
if (isset($attributes['time']))
{
- $attributes['date'] = $user->format_date($attributes['time']);
+ $attributes['date'] = $this->user->format_date($attributes['time']);
}
if (isset($attributes['user_id']))
{
- $attributes['profile_url'] = str_replace('{USER_ID}', $attributes['user_id'], $profile_url);
+ $attributes['profile_url'] = str_replace('{USER_ID}', $attributes['user_id'], $this->profile_url);
}
return $attributes;