aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/avatar/driver/gravatar.php4
-rw-r--r--phpBB/phpbb/avatar/driver/remote.php4
-rw-r--r--phpBB/phpbb/captcha/plugins/qa.php14
-rw-r--r--phpBB/phpbb/content_visibility.php10
-rw-r--r--phpBB/phpbb/cron/manager.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php3
-rw-r--r--phpBB/phpbb/db/migration/data/v320/v320rc1.php40
-rw-r--r--phpBB/phpbb/install/console/command/install/install.php1
-rw-r--r--phpBB/phpbb/install/helper/database.php6
-rw-r--r--phpBB/phpbb/install/helper/iohandler/cli_iohandler.php9
-rw-r--r--phpBB/phpbb/install/installer_configuration.php3
-rw-r--r--phpBB/phpbb/install/module/install_database/task/add_config_settings.php4
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php7
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php2
-rw-r--r--phpBB/phpbb/language/language_file_helper.php1
-rw-r--r--phpBB/phpbb/notification/manager.php9
-rw-r--r--phpBB/phpbb/notification/type/base.php39
-rw-r--r--phpBB/phpbb/search/base.php46
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php2
19 files changed, 130 insertions, 76 deletions
diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php
index b8cf84424a..3e4e7ff98b 100644
--- a/phpBB/phpbb/avatar/driver/gravatar.php
+++ b/phpBB/phpbb/avatar/driver/gravatar.php
@@ -52,8 +52,8 @@ class gravatar extends \phpbb\avatar\driver\driver
public function prepare_form($request, $template, $user, $row, &$error)
{
$template->assign_vars(array(
- 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', 0),
- 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_gravatar_width', 0),
+ 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', ''),
+ 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_gravatar_width', ''),
'AVATAR_GRAVATAR_EMAIL' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar']) ? $row['avatar'] : '',
));
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
index 0526b9184e..3a88a432d1 100644
--- a/phpBB/phpbb/avatar/driver/remote.php
+++ b/phpBB/phpbb/avatar/driver/remote.php
@@ -36,8 +36,8 @@ class remote extends \phpbb\avatar\driver\driver
public function prepare_form($request, $template, $user, $row, &$error)
{
$template->assign_vars(array(
- 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', 0),
- 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_remote_width', 0),
+ 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', ''),
+ 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_remote_width', ''),
'AVATAR_REMOTE_URL' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar']) ? $row['avatar'] : '',
));
diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php
index 7f804850a4..9d481acc5d 100644
--- a/phpBB/phpbb/captcha/plugins/qa.php
+++ b/phpBB/phpbb/captcha/plugins/qa.php
@@ -222,7 +222,11 @@ class qa
{
global $phpbb_log, $template, $user;
- if ($this->is_solved() || empty($this->question_text) || !count($this->question_ids))
+ if ($this->is_solved())
+ {
+ return false;
+ }
+ else if (empty($this->question_text) || !count($this->question_ids))
{
/** @var \phpbb\log\log_interface $phpbb_log */
$phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING')));
@@ -231,10 +235,10 @@ class qa
else
{
$template->assign_vars(array(
- 'QA_CONFIRM_QUESTION' => $this->question_text,
- 'QA_CONFIRM_ID' => $this->confirm_id,
- 'S_CONFIRM_CODE' => true,
- 'S_TYPE' => $this->type,
+ 'QA_CONFIRM_QUESTION' => $this->question_text,
+ 'QA_CONFIRM_ID' => $this->confirm_id,
+ 'S_CONFIRM_CODE' => true,
+ 'S_TYPE' => $this->type,
));
return 'captcha_qa.html';
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 0ba0489cb7..147b8ebbff 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -417,6 +417,11 @@ class content_visibility
return array();
}
+ if (!function_exists('truncate_string'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_content.' . $this->php_ext);
+ }
+
$data = array(
'post_visibility' => (int) $visibility,
'post_delete_user' => (int) $user_id,
@@ -628,6 +633,11 @@ class content_visibility
}
}
+ if (!function_exists('truncate_string'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_content.' . $this->php_ext);
+ }
+
// Note, we do not set a reason for the posts, just for the topic
$data = array(
'topic_visibility' => (int) $visibility,
diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php
index 079ce8107e..9bd30a0a5b 100644
--- a/phpBB/phpbb/cron/manager.php
+++ b/phpBB/phpbb/cron/manager.php
@@ -110,7 +110,7 @@ class manager
* Web runner uses this method to resolve names to tasks.
*
* @param string $name Name of the task to look up.
- * @return \phpbb\cron\task\task A task corresponding to the given name, or null.
+ * @return \phpbb\cron\task\wrapper A wrapped task corresponding to the given name, or null.
*/
public function find_task($name)
{
diff --git a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php
index c40504051e..6e81baefb9 100644
--- a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php
+++ b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php
@@ -38,8 +38,9 @@ class report_id_auto_increment extends \phpbb\db\migration\migration
return array(
'change_columns' => array(
$this->table_prefix . 'reports' => array(
- 'report_id' => array('ULINT', 0), 0),
+ 'report_id' => array('ULINT', 0),
),
+ ),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v320/v320rc1.php b/phpBB/phpbb/db/migration/data/v320/v320rc1.php
new file mode 100644
index 0000000000..a04a2abb19
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/v320rc1.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v320;
+
+use phpbb\db\migration\migration;
+
+class v320rc1 extends migration
+{
+ public function effectively_installed()
+ {
+ return version_compare($this->config['version'], '3.2.0-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v319',
+ '\phpbb\db\migration\data\v320\report_id_auto_increment',
+ '\phpbb\db\migration\data\v320\v320b2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.2.0-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/install/install.php b/phpBB/phpbb/install/console/command/install/install.php
index 50c23f6877..de3a2e2d61 100644
--- a/phpBB/phpbb/install/console/command/install/install.php
+++ b/phpBB/phpbb/install/console/command/install/install.php
@@ -190,6 +190,7 @@ class install extends \phpbb\console\command\command
$iohandler->set_input('email_enable', $config['email']['enabled']);
$iohandler->set_input('smtp_delivery', $config['email']['smtp_delivery']);
$iohandler->set_input('smtp_host', $config['email']['smtp_host']);
+ $iohandler->set_input('smtp_port', $config['email']['smtp_port']);
$iohandler->set_input('smtp_auth', $config['email']['smtp_auth']);
$iohandler->set_input('smtp_user', $config['email']['smtp_user']);
$iohandler->set_input('smtp_pass', $config['email']['smtp_pass']);
diff --git a/phpBB/phpbb/install/helper/database.php b/phpBB/phpbb/install/helper/database.php
index c4c90a01a4..b8422fc1ed 100644
--- a/phpBB/phpbb/install/helper/database.php
+++ b/phpBB/phpbb/install/helper/database.php
@@ -58,7 +58,7 @@ class database
'LABEL' => 'MS SQL Server 2000+',
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
- 'DELIM' => 'GO',
+ 'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mssql',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -67,7 +67,7 @@ class database
'LABEL' => 'MS SQL Server [ ODBC ]',
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
- 'DELIM' => 'GO',
+ 'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mssql_odbc',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -76,7 +76,7 @@ class database
'LABEL' => 'MS SQL Server 2005+ [ Native ]',
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
- 'DELIM' => 'GO',
+ 'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
diff --git a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php
index 94550d2db0..2a41cb10ba 100644
--- a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php
+++ b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php
@@ -124,13 +124,14 @@ class cli_iohandler extends iohandler_base
public function add_error_message($error_title, $error_description = false)
{
$this->io->newLine();
+ $message = $this->translate_message($error_title, $error_description);
+ $message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : '');
- if (strpos($error_title, '<br />') !== false)
+ if (strpos($message_string, '<br />') !== false)
{
- $error_title = strip_tags(str_replace('<br />', "\n", $error_title));
+ $message_string = strip_tags(str_replace('<br />', "\n", $message_string));
}
- $message = $this->translate_message($error_title, $error_description);
- $message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : '');
+
$this->io->error($message_string);
if ($this->progress_bar !== null)
diff --git a/phpBB/phpbb/install/installer_configuration.php b/phpBB/phpbb/install/installer_configuration.php
index ab02da8686..c660c99d0f 100644
--- a/phpBB/phpbb/install/installer_configuration.php
+++ b/phpBB/phpbb/install/installer_configuration.php
@@ -93,6 +93,9 @@ class installer_configuration implements ConfigurationInterface
->scalarNode('smtp_host')
->defaultValue(null)
->end()
+ ->scalarNode('smtp_port')
+ ->defaultValue(null)
+ ->end()
->scalarNode('smtp_auth')
->defaultValue(null)
->end()
diff --git a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
index 7a2df01de6..8002e3ed97 100644
--- a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
+++ b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
@@ -191,6 +191,10 @@ class add_config_settings extends \phpbb\install\task_base
WHERE config_name = 'smtp_host'",
'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_port')) . "'
+ WHERE config_name = 'smtp_port'",
+
+ 'UPDATE ' . $this->config_table . "
SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_auth')) . "'
WHERE config_name = 'smtp_auth_method'",
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
index 606e4a2ddd..1cb4f04297 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
@@ -51,6 +51,7 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
$email_enable = $this->io_handler->get_input('email_enable', true);
$smtp_delivery = $this->io_handler->get_input('smtp_delivery', '');
$smtp_host = $this->io_handler->get_input('smtp_host', '');
+ $smtp_port = $this->io_handler->get_input('smtp_port', '');
$smtp_auth = $this->io_handler->get_input('smtp_auth', '');
$smtp_user = $this->io_handler->get_input('smtp_user', '');
$smtp_passwd = $this->io_handler->get_input('smtp_pass', '');
@@ -63,6 +64,7 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
$this->install_config->set('email_enable', $email_enable);
$this->install_config->set('smtp_delivery', $smtp_delivery);
$this->install_config->set('smtp_host', $smtp_host);
+ $this->install_config->set('smtp_port', $smtp_port);
$this->install_config->set('smtp_auth', $smtp_auth);
$this->install_config->set('smtp_user', $smtp_user);
$this->install_config->set('smtp_pass', $smtp_passwd);
@@ -119,6 +121,11 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
'type' => 'text',
'default' => $smtp_host,
),
+ 'smtp_port' => array(
+ 'label' => 'SMTP_PORT',
+ 'type' => 'text',
+ 'default' => $smtp_port,
+ ),
'smtp_auth' => array(
'label' => 'SMTP_AUTH_METHOD',
'description' => 'SMTP_AUTH_METHOD_EXPLAIN',
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php
index 9f74b61770..377d96ed1a 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php
@@ -37,7 +37,7 @@ class obtain_imagick_path extends \phpbb\install\task_base implements \phpbb\ins
*/
public function run()
{
- // Can we find Imagemagick anywhere on the system?
+ // Can we find ImageMagick anywhere on the system?
$exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : '';
$magic_home = getenv('MAGICK_HOME');
diff --git a/phpBB/phpbb/language/language_file_helper.php b/phpBB/phpbb/language/language_file_helper.php
index 18d7b62e21..85de034fb8 100644
--- a/phpBB/phpbb/language/language_file_helper.php
+++ b/phpBB/phpbb/language/language_file_helper.php
@@ -47,6 +47,7 @@ class language_file_helper
$finder->files()
->name('iso.txt')
->depth('== 1')
+ ->followLinks()
->in($this->phpbb_root_path . 'language');
$available_languages = array();
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index 3265bcb629..023e1610f0 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -943,11 +943,16 @@ class manager
/**
* Get notification type ids (as an array)
*
- * @param array $notification_type_names Array of strings
+ * @param string|array $notification_type_names Notification type names
* @return array Array of integers
*/
- public function get_notification_type_ids(array $notification_type_names)
+ public function get_notification_type_ids($notification_type_names)
{
+ if (!is_array($notification_type_names))
+ {
+ $notification_type_names = array($notification_type_names);
+ }
+
$notification_type_ids = array();
foreach ($notification_type_names as $name)
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index 4aacb1c99e..77ed7f2b09 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -449,7 +449,7 @@ abstract class base implements \phpbb\notification\type\type_interface
return array();
}
- $rowset = $resulting_user_ids = array();
+ $rowset = $output = array();
$sql = 'SELECT user_id, method, notify
FROM ' . $this->user_notifications_table . '
@@ -460,9 +460,7 @@ abstract class base implements \phpbb\notification\type\type_interface
while ($row = $this->db->sql_fetchrow($result))
{
- $resulting_user_ids[] = $row['user_id'];
-
- if (!$row['notify'] || (isset($options['ignore_users'][$row['user_id']]) && in_array($row['method'], $options['ignore_users'][$row['user_id']])))
+ if (isset($options['ignore_users'][$row['user_id']]) && in_array($row['method'], $options['ignore_users'][$row['user_id']]))
{
continue;
}
@@ -471,22 +469,47 @@ abstract class base implements \phpbb\notification\type\type_interface
{
$rowset[$row['user_id']] = array();
}
+ $rowset[$row['user_id']][$row['method']] = $row['notify'];
- $rowset[$row['user_id']][] = $row['method'];
+ if (!isset($output[$row['user_id']]))
+ {
+ $output[$row['user_id']] = array();
+ }
+ if ($row['notify'])
+ {
+ $output[$row['user_id']][] = $row['method'];
+ }
}
$this->db->sql_freeresult($result);
+ $default_methods = $this->notification_manager->get_default_methods();
+
foreach ($user_ids as $user_id)
{
- if (!in_array($user_id, $resulting_user_ids) && !isset($options['ignore_users'][$user_id]))
+ if (isset($options['ignore_users'][$user_id]))
+ {
+ continue;
+ }
+ if (!array_key_exists($user_id, $rowset))
{
// No rows at all for this user, use the default methods
- $rowset[$user_id] = $this->notification_manager->get_default_methods();
+ $output[$user_id] = $default_methods;
+ }
+ else
+ {
+ foreach ($default_methods as $default_method)
+ {
+ if (!array_key_exists($default_method, $rowset[$user_id]))
+ {
+ // No user preference for this type recorded, but it should be enabled by default.
+ $output[$user_id][] = $default_method;
+ }
+ }
}
}
- return $rowset;
+ return $output;
}
/**
diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php
index 30781975d8..d9313dddab 100644
--- a/phpBB/phpbb/search/base.php
+++ b/phpBB/phpbb/search/base.php
@@ -37,52 +37,6 @@ class base
}
/**
- * Retrieves a language dependend list of words that should be ignored by the search
- */
- function get_ignore_words()
- {
- if (!sizeof($this->ignore_words))
- {
- global $user, $phpEx;
-
- $words = array();
-
- if (file_exists("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx"))
- {
- // include the file containing ignore words
- include("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx");
- }
-
- $this->ignore_words = $words;
- unset($words);
- }
- }
-
- /**
- * Stores a list of synonyms that should be replaced in $this->match_synonym and $this->replace_synonym and caches them
- */
- function get_synonyms()
- {
- if (!sizeof($this->match_synonym))
- {
- global $user, $phpEx;
-
- $synonyms = array();
-
- if (file_exists("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx"))
- {
- // include the file containing synonyms
- include("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx");
- }
-
- $this->match_synonym = array_keys($synonyms);
- $this->replace_synonym = array_values($synonyms);
-
- unset($synonyms);
- }
- }
-
- /**
* Retrieves cached search results
*
* @param string $search_key an md5 string generated from all the passed search options to identify the results
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index 8c273c342e..8d1c0fabfe 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -82,7 +82,7 @@ class factory implements \phpbb\textformatter\cache_interface
'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
'i' => '[I]{TEXT}[/I]',
'img' => '[IMG src={IMAGEURL;useContent}]',
- 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext}]{TEXT}[/LIST]',
+ 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext} #createChild=LI]{TEXT}[/LIST]',
'li' => '[* $tagName=LI]{TEXT}[/*]',
'quote' =>
"[QUOTE