aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textreparser/plugins
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-01 19:21:01 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-30 17:26:00 +0200
commitb5911281ae175340817345e63ddbfaf43abb3cec (patch)
tree044e1fe16209c353e55689febe322096b5b1b6bc /phpBB/phpbb/textreparser/plugins
parent986af43f37342953bff548630aa33904c21234f4 (diff)
downloadforums-b5911281ae175340817345e63ddbfaf43abb3cec.tar
forums-b5911281ae175340817345e63ddbfaf43abb3cec.tar.gz
forums-b5911281ae175340817345e63ddbfaf43abb3cec.tar.bz2
forums-b5911281ae175340817345e63ddbfaf43abb3cec.tar.xz
forums-b5911281ae175340817345e63ddbfaf43abb3cec.zip
[ticket/13803] Added tests, fixed param order in generate_text_for_storage()
PHPBB3-13803
Diffstat (limited to 'phpBB/phpbb/textreparser/plugins')
-rw-r--r--phpBB/phpbb/textreparser/plugins/user_signature.php39
1 files changed, 36 insertions, 3 deletions
diff --git a/phpBB/phpbb/textreparser/plugins/user_signature.php b/phpBB/phpbb/textreparser/plugins/user_signature.php
index 2beaaf98e5..7a66f39ab6 100644
--- a/phpBB/phpbb/textreparser/plugins/user_signature.php
+++ b/phpBB/phpbb/textreparser/plugins/user_signature.php
@@ -16,14 +16,47 @@ namespace phpbb\textreparser\plugins;
class user_signature extends \phpbb\textreparser\row_based_plugin
{
/**
+ * @var array Bit numbers used for user options
+ * @see \phpbb\user
+ */
+ 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)
+ {
+ $options = $row['user_options'];
+ $row += array(
+ 'enable_bbcode' => phpbb_optionget($this->keyoptions['sig_bbcode'], $options),
+ 'enable_smilies' => phpbb_optionget($this->keyoptions['sig_smilies'], $options),
+ 'enable_magic_url' => phpbb_optionget($this->keyoptions['sig_links'], $options),
+ );
+
+ return $row;
+ }
+
+ /**
* {@inheritdoc}
*/
protected function get_columns()
{
return array(
- 'id' => 'user_id',
- 'text' => 'user_sig',
- 'bbcode_uid' => 'user_sig_bbcode_uid',
+ 'id' => 'user_id',
+ 'text' => 'user_sig',
+ 'bbcode_uid' => 'user_sig_bbcode_uid',
+ 'user_options' => 'user_options',
);
}