aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/notification/type/post.php8
-rw-r--r--phpBB/phpbb/session.php2
-rw-r--r--phpBB/phpbb/template/twig/extension.php3
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php13
-rw-r--r--phpBB/phpbb/textformatter/utils_interface.php18
5 files changed, 35 insertions, 9 deletions
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index b9afc6d70a..03221e7c7a 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -456,6 +456,12 @@ class post extends \phpbb\notification\type\base
return array();
}
- return array('notification_data' => $serialized_data);
+ $data_array = array_merge(array(
+ 'post_time' => $post['post_time'],
+ 'post_id' => $post['post_id'],
+ 'topic_id' => $post['topic_id']
+ ), $this->get_data(false));
+
+ return $data_array;
}
}
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index cbe2f02851..cc200b1adc 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -838,7 +838,7 @@ class session
$sql = 'SELECT COUNT(session_id) AS sessions
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . (int) $this->data['user_id'] . '
- AND session_time >= ' . (int) ($this->time_now - (max($config['session_length'], $config['form_token_lifetime'])));
+ AND session_time >= ' . (int) ($this->time_now - (max((int) $config['session_length'], (int) $config['form_token_lifetime'])));
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 92f87a0331..f0e716d697 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -170,8 +170,7 @@ class extension extends \Twig_Extension
$args = func_get_args();
$key = $args[0];
- $context = $this->context->get_data_ref();
- $context_vars = $context['.'][0];
+ $context_vars = $this->context->get_root_ref();
if (isset($context_vars['L_' . $key]))
{
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
index b317fe4a8d..a9a6d4b892 100644
--- a/phpBB/phpbb/textformatter/s9e/utils.php
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -136,4 +136,17 @@ class utils implements \phpbb\textformatter\utils_interface
{
return \s9e\TextFormatter\Unparser::unparse($xml);
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_empty($text)
+ {
+ if ($text === null || $text === '')
+ {
+ return true;
+ }
+
+ return trim($this->unparse($text)) === '';
+ }
}
diff --git a/phpBB/phpbb/textformatter/utils_interface.php b/phpBB/phpbb/textformatter/utils_interface.php
index 4810453cd1..4b7392976a 100644
--- a/phpBB/phpbb/textformatter/utils_interface.php
+++ b/phpBB/phpbb/textformatter/utils_interface.php
@@ -62,10 +62,18 @@ interface utils_interface
public function remove_bbcode($text, $bbcode_name, $depth = 0);
/**
- * Return a parsed text to its original form
- *
- * @param string $text Parsed text
- * @return string Original plain text
- */
+ * Return a parsed text to its original form
+ *
+ * @param string $text Parsed text
+ * @return string Original plain text
+ */
public function unparse($text);
+
+ /**
+ * Return whether or not a parsed text represent an empty text.
+ *
+ * @param string $text Parsed text
+ * @return bool Tue if the original text is empty
+ */
+ public function is_empty($text);
}