aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-06 21:32:39 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-30 17:26:00 +0200
commita870f8f8603993a2d6a2443c8ad746212071f392 (patch)
treee85e418ac086de7fb68da60e1736b32ce12c4e7b /phpBB
parent212fc277b481440a99ff0483e5fbc40c790e8dda (diff)
downloadforums-a870f8f8603993a2d6a2443c8ad746212071f392.tar
forums-a870f8f8603993a2d6a2443c8ad746212071f392.tar.gz
forums-a870f8f8603993a2d6a2443c8ad746212071f392.tar.bz2
forums-a870f8f8603993a2d6a2443c8ad746212071f392.tar.xz
forums-a870f8f8603993a2d6a2443c8ad746212071f392.zip
[ticket/13803] Added user_signature tests
PHPBB3-13803
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/textreparser/plugins/user_signature.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/phpBB/phpbb/textreparser/plugins/user_signature.php b/phpBB/phpbb/textreparser/plugins/user_signature.php
index db82d4089b..f657a45d38 100644
--- a/phpBB/phpbb/textreparser/plugins/user_signature.php
+++ b/phpBB/phpbb/textreparser/plugins/user_signature.php
@@ -22,21 +22,15 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
protected $keyoptions;
/**
- * Constructor
- *
- * Retrieves and saves the bit numbers used for user options
- */
- public function __construct()
- {
- $class_vars = get_class_vars('phpbb\\user');
- $this->keyoptions = $class_vars['keyoptions'];
- }
-
- /**
* {@inheritdoc}
*/
protected function add_missing_fields(array $row)
{
+ if (!isset($this->keyoptions))
+ {
+ $this->save_keyoptions();
+ }
+
$options = $row['user_options'];
$row += array(
'enable_bbcode' => phpbb_optionget($this->keyoptions['sig_bbcode'], $options),
@@ -44,7 +38,7 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
'enable_magic_url' => phpbb_optionget($this->keyoptions['sig_links'], $options),
);
- return $row;
+ return parent::add_missing_fields($row);
}
/**
@@ -67,4 +61,13 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
{
return USERS_TABLE;
}
+
+ /**
+ * Save the keyoptions var from \phpbb\user
+ */
+ protected function save_keyoptions()
+ {
+ $class_vars = get_class_vars('phpbb\\user');
+ $this->keyoptions = $class_vars['keyoptions'];
+ }
}