aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_attachments.html2
-rw-r--r--phpBB/adm/style/acp_inactive.html4
-rw-r--r--phpBB/adm/style/acp_logs.html3
-rw-r--r--phpBB/adm/style/acp_main.html4
-rw-r--r--phpBB/adm/style/admin.css66
-rw-r--r--phpBB/assets/javascript/core.js155
-rw-r--r--phpBB/config/parameters.yml1
-rw-r--r--phpBB/config/services.yml4
-rw-r--r--phpBB/feed.php2
-rw-r--r--phpBB/includes/functions.php12
-rw-r--r--phpBB/includes/functions_acp.php2
-rw-r--r--phpBB/includes/functions_download.php10
-rw-r--r--phpBB/includes/functions_posting.php8
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php3
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php10
-rw-r--r--phpBB/install/database_update.php14
-rw-r--r--phpBB/install/index.php2
-rw-r--r--phpBB/language/en/posting.php2
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php9
-rw-r--r--phpBB/phpbb/controller/helper.php49
-rw-r--r--phpBB/phpbb/db/migrator.php19
-rw-r--r--phpBB/phpbb/extension/base.php21
-rw-r--r--phpBB/posting.php10
-rw-r--r--phpBB/styles/prosilver/template/ajax.js8
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
-rw-r--r--phpBB/styles/prosilver/template/pagination.html2
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css79
-rw-r--r--phpBB/viewforum.php43
29 files changed, 283 insertions, 265 deletions
diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html
index 59b10f597e..da8a0096ea 100644
--- a/phpBB/adm/style/acp_attachments.html
+++ b/phpBB/adm/style/acp_attachments.html
@@ -284,8 +284,6 @@
</fieldset>
</form>
- <br />
-
<form id="change_ext" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html
index 1cdc1abe6b..409ea46de5 100644
--- a/phpBB/adm/style/acp_inactive.html
+++ b/phpBB/adm/style/acp_inactive.html
@@ -2,14 +2,12 @@
<a id="maincontent"></a>
-<h2>{L_INACTIVE_USERS}</h2>
+<h1>{L_INACTIVE_USERS}</h1>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
-<div class="clearfix"></div>
-
<!-- IF .pagination -->
<div class="pagination">
<!-- INCLUDE pagination.html -->
diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html
index ec2065f906..4f67f46e24 100644
--- a/phpBB/adm/style/acp_logs.html
+++ b/phpBB/adm/style/acp_logs.html
@@ -18,9 +18,6 @@
</div>
<!-- ENDIF -->
-<div class="clearfix">&nbsp;</div>
-<div><br style="clear: both;" /></div>
-
<!-- IF .log -->
<table class="table1 zebra-table fixed-width-table">
<thead>
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html
index 9a9b3ff2b9..065dd7ac4f 100644
--- a/phpBB/adm/style/acp_main.html
+++ b/phpBB/adm/style/acp_main.html
@@ -243,9 +243,6 @@
<!-- END log -->
</tbody>
</table>
-
- <br />
-
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
@@ -287,7 +284,6 @@
<!-- END inactive -->
</tbody>
</table>
-
<!-- ENDIF -->
<!-- ENDIF -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index b8f55e66c5..b83750875a 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -154,6 +154,10 @@ a:active {
font-weight: bold;
}
+a#maincontent, a#acl, a#assigned_to {
+ display: block;
+}
+
/* List items */
ul, ol {
list-style-position: inside;
@@ -174,7 +178,6 @@ li {
}
#page-header {
- clear: both;
text-align: right;
background: url("../images/phpbb_logo.png") top left no-repeat;
height: 54px;
@@ -203,14 +206,9 @@ li {
}
#page-body {
- clear: both;
min-width: 650px;
}
-#page-footer {
- clear: both;
-}
-
.copyright {
font-size: 0.75em;
text-align: center;
@@ -335,12 +333,6 @@ li {
padding: 0;
}
-#tabs > ul:after {
- content: '';
- display: block;
- clear: both;
-}
-
#tabs .tab {
display: inline-block;
float: left;
@@ -475,7 +467,6 @@ li {
/* Main Panel
---------------------------------------- */
#acp {
- clear: both;
position: relative;
top: -2px;
margin: 0 0 2px;
@@ -723,6 +714,7 @@ td {
.table1 {
border-collapse: separate;
border-spacing: 1px;
+ clear: both;
}
dt#color_palette_placeholder table {
@@ -862,10 +854,10 @@ table.zebra-table tbody tr:nth-child(even) {
}
/* Deactivated row */
-.row-inactive {
- color: #999;
+.row-inactive {
+ color: #999;
}
-.row-inactive a, .row-inactive strong {
+.row-inactive a, .row-inactive strong {
color: #888;
}
.row-inactive a:hover {
@@ -1132,6 +1124,11 @@ input.langvalue, textarea.langvalue {
width: 90%;
}
+input[type="number"] {
+ width: 60px;
+ -moz-padding-end: 0;
+}
+
optgroup, select {
background-color: #FAFAFA;
border: 1px solid #666666;
@@ -1226,8 +1223,8 @@ fieldset.quick legend {
fieldset.tabulated {
background: none;
margin: 0;
+ margin-top: 5px;
padding: 0;
- padding-top: 5px;
border: 0;
}
@@ -1464,7 +1461,7 @@ input:focus, textarea:focus {
{
select, dd select, dd input {
max-width: 240px;
- }
+ }
}
/* Submit button fieldset or paragraph
@@ -1676,12 +1673,12 @@ input.button1:focus, input.button2:focus {
height: 1%; /* IE tweak (holly hack) */
width: auto;
text-align: right;
- margin-top: 5px;
+ margin: 5px 0;
}
.top-pagination {
float: right;
- margin: 15px 0 2px 0;
+ margin: 15px 0 5px 0;
}
.rtl .pagination {
@@ -1877,17 +1874,7 @@ li.pagination ul {
vertical-align: middle;
}
-/* Nice method for clearing floated blocks without having to insert any extra markup
- From http://www.positioniseverything.net/easyclearing.html
-.clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}*/
-
-.clearfix, .row, #content, fieldset dl, #page-body {
+.row, fieldset dl {
overflow: hidden;
}
@@ -2470,3 +2457,20 @@ fieldset.permissions .padding {
.responsive-show-inline { display: inline !important; }
.responsive-show-inline-block { display: inline-block !important; }
}
+
+.clearfix {
+ overflow: hidden;
+}
+
+.pagination:after,
+#page-header:after,
+#page-body:after,
+#tabs:after,
+#tabs > ul:after,
+#tabs li:after,
+#acp:after,
+#content:after {
+ content: '';
+ clear: both;
+ display: block;
+}
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 802b4dd7c8..b5187991f9 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -79,40 +79,27 @@ phpbb.alert = function(title, msg, fadedark) {
$alert.find('.alert_title').html(title);
$alert.find('.alert_text').html(msg);
- if (!$dark.is(':visible')) {
- $dark.fadeIn(phpbb.alertTime);
- }
-
- $alert.on('click', function(e) {
- e.stopPropagation();
- });
- $dark.one('click', function(e) {
- var fade;
-
- $alert.find('.alert_close').off('click');
- fade = (typeof fadedark !== 'undefined' && !fadedark) ? $alert : $dark;
- fade.fadeOut(phpbb.alertTime, function() {
- $alert.hide();
- });
-
- e.preventDefault();
- e.stopPropagation();
- });
-
- $(document).keydown(function(e) {
- if ((e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) && $dark.is(':visible')) {
- $dark.trigger('click');
-
+ $(document).on('keydown.phpbb.alert', function(e) {
+ if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
+ phpbb.alert.close($alert, true);
e.preventDefault();
e.stopPropagation();
}
});
+ phpbb.alert.open($alert);
- $alert.find('.alert_close').one('click', function(e) {
- $dark.trigger('click');
+ return $alert;
+};
- e.preventDefault();
- });
+/**
+* Handler for opening an alert box.
+*
+* @param jQuery $alert jQuery object.
+*/
+phpbb.alert.open = function($alert) {
+ if (!$dark.is(':visible')) {
+ $dark.fadeIn(phpbb.alertTime);
+ }
if ($loadingIndicator.is(':visible')) {
$loadingIndicator.fadeOut(phpbb.alertTime, function() {
@@ -128,7 +115,37 @@ phpbb.alert = function(title, msg, fadedark) {
$dark.fadeIn(phpbb.alertTime);
}
- return $alert;
+ $alert.on('click', function(e) {
+ e.stopPropagation();
+ });
+
+ $dark.one('click', function(e) {
+ phpbb.alert.close($alert, true);
+ e.preventDefault();
+ e.stopPropagation();
+ });
+
+ $alert.find('.alert_close').one('click', function(e) {
+ phpbb.alert.close($alert, true);
+ e.preventDefault();
+ });
+};
+
+/**
+* Handler for closing an alert box.
+*
+* @param jQuery $alert jQuery object.
+* @param bool fadedark Whether to remove dark background.
+*/
+phpbb.alert.close = function($alert, fadedark) {
+ var $fade = (fadedark) ? $dark : $alert;
+
+ $fade.fadeOut(phpbb.alertTime, function() {
+ $alert.hide();
+ });
+
+ $alert.find('.alert_close').off('click');
+ $(document).off('keydown.phpbb.alert');
};
/**
@@ -147,77 +164,32 @@ phpbb.alert = function(title, msg, fadedark) {
phpbb.confirm = function(msg, callback, fadedark) {
var $confirmDiv = $('#phpbb_confirm');
$confirmDiv.find('.alert_text').html(msg);
+ fadedark = fadedark || true;
- if (!$dark.is(':visible')) {
- $dark.fadeIn(phpbb.alertTime);
- }
-
- $confirmDiv.on('click', function(e) {
- e.stopPropagation();
- });
-
- var clickHandler = function(e) {
- var res = this.name === 'confirm';
- var $fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? $confirmDiv : $dark;
- $fade.fadeOut(phpbb.alertTime, function() {
- $confirmDiv.hide();
- });
- $confirmDiv.find('input[type="button"]').off('click', clickHandler);
- callback(res);
+ $(document).on('keydown.phpbb.alert', function(e) {
+ if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
+ var name = (e.keyCode === keymap.ENTER) ? 'confirm' : 'cancel';
- if (e) {
+ $('input[name="' + name + '"]').trigger('click');
e.preventDefault();
e.stopPropagation();
}
- };
- $confirmDiv.find('input[type="button"]').one('click', clickHandler);
-
- $dark.one('click', function(e) {
- $confirmDiv.find('.alert_close').off('click');
- $dark.fadeOut(phpbb.alertTime, function() {
- $confirmDiv.hide();
- });
- callback(false);
-
- e.preventDefault();
- e.stopPropagation();
});
- $(document).on('keydown', function(e) {
- if (e.keyCode === keymap.ENTER) {
- $('input[name="confirm"]').trigger('click');
- e.preventDefault();
- e.stopPropagation();
- } else if (e.keyCode === keymap.ESC) {
- $('input[name="cancel"]').trigger('click');
- e.preventDefault();
- e.stopPropagation();
- }
- });
+ $confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) {
+ var confirmed = this.name === 'confirm';
- $confirmDiv.find('.alert_close').one('click', function(e) {
- var $fade = (typeof fadedark !== 'undefined' && fadedark) ? $confirmDiv : $dark;
- $fade.fadeOut(phpbb.alertTime, function() {
- $confirmDiv.hide();
- });
- callback(false);
+ if (confirmed) {
+ callback(true);
+ }
+ $confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox');
+ phpbb.alert.close($confirmDiv, fadedark || !confirmed);
e.preventDefault();
+ e.stopPropagation();
});
- if ($loadingIndicator.is(':visible')) {
- $loadingIndicator.fadeOut(phpbb.alertTime, function() {
- $dark.append($confirmDiv);
- $confirmDiv.fadeIn(phpbb.alertTime);
- });
- } else if ($dark.is(':visible')) {
- $dark.append($confirmDiv);
- $confirmDiv.fadeIn(phpbb.alertTime);
- } else {
- $dark.append($confirmDiv);
- $confirmDiv.show();
- $dark.fadeIn(phpbb.alertTime);
- }
+ phpbb.alert.open($confirmDiv);
return $confirmDiv;
};
@@ -810,12 +782,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) {
.insertAfter('#timezone');
} else {
// Copy the content of our backup, so we can remove all unneeded options
- var $replacement = $timezoneCopy.clone();
- $replacement.attr('id', 'timezone')
- .css('display', 'block')
- .attr('name', 'tz');
-
- $timezone.replaceWith($replacement);
+ $timezone.html($timezoneCopy.html());
}
if ($tzDate.val() !== '') {
diff --git a/phpBB/config/parameters.yml b/phpBB/config/parameters.yml
index 5bf2c678ee..b076ea3ecb 100644
--- a/phpBB/config/parameters.yml
+++ b/phpBB/config/parameters.yml
@@ -1,2 +1,3 @@
parameters:
+ core.disable_super_globals: true
datetime.class: \phpbb\datetime
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index b61641a5a4..cca655263f 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -100,6 +100,7 @@ services:
- @controller.provider
- @ext.manager
- @symfony_request
+ - @filesystem
- %core.root_path%
- %core.php_ext%
@@ -313,6 +314,9 @@ services:
request:
class: phpbb\request\request
+ arguments:
+ - null
+ - %core.disable_super_globals%
symfony_request:
class: phpbb\symfony_request
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 8971bae768..d4dfb15928 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -164,7 +164,7 @@ if (defined('DEBUG') && request_var('explain', 0) && $auth->acl_get('a_'))
{
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Pragma: no-cache');
$mtime = explode(' ', microtime());
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 1de70d4210..a61518401c 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1989,6 +1989,9 @@ function tracking_unserialize($string, $max_depth = 3)
* @param mixed $params String or array of additional url parameters
* @param bool $is_amp Is url using &amp; (true) or & (false)
* @param string $session_id Possibility to use a custom session id instead of the global one
+* @param bool $is_route Is url generated by a route.
+*
+* @return string The corrected url.
*
* Examples:
* <code>
@@ -1999,7 +2002,7 @@ function tracking_unserialize($string, $max_depth = 3)
* </code>
*
*/
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
+function append_sid($url, $params = false, $is_amp = true, $session_id = false, $is_route = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_path_helper;
global $phpbb_dispatcher;
@@ -2011,7 +2014,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
}
// Update the root path with the correct relative web path
- if ($phpbb_path_helper instanceof \phpbb\path_helper)
+ if (!$is_route && $phpbb_path_helper instanceof \phpbb\path_helper)
{
$url = $phpbb_path_helper->update_web_root_path($url);
}
@@ -2037,9 +2040,10 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
* the global one (false)
* @var bool|string append_sid_overwrite Overwrite function (string
* URL) or not (false)
+ * @var bool is_route Is url generated by a route.
* @since 3.1.0-a1
*/
- $vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite');
+ $vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite', 'is_route');
extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars)));
if ($append_sid_overwrite)
@@ -5058,7 +5062,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
- 'Expires' => '0',
+ 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
'Pragma' => 'no-cache',
);
if (!empty($user->data['is_bot']))
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index d9dc11239c..da8d756db9 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -112,7 +112,7 @@ function adm_page_header($page_title)
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
- 'Expires' => '0',
+ 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
'Pragma' => 'no-cache',
);
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 4ff3994f4c..3be84299f0 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -56,17 +56,17 @@ function send_avatar_to_browser($file, $browser)
if (strpos(strtolower($browser), 'msie 6.0') !== false)
{
- header('Expires: -1');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
}
else
{
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
}
}
else
{
header('Content-Disposition: inline; ' . header_filename($file));
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
}
$size = @filesize($file_path);
@@ -197,7 +197,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
{
- header('expires: -1');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
}
}
else
@@ -421,7 +421,7 @@ function set_modified_headers($stamp, $browser)
send_status_line(304, 'Not Modified');
// seems that we need those too ... browsers
header('Pragma: public');
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
return true;
}
else
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 768011fa5b..1fdc7ee9ea 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -2538,7 +2538,7 @@ function phpbb_upload_popup($forum_style = 0)
/**
* Do the various checks required for removing posts as well as removing it
*/
-function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $soft_delete_reason = '')
+function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $delete_reason = '')
{
global $user, $auth, $config, $request;
global $phpbb_root_path, $phpEx;
@@ -2571,19 +2571,19 @@ function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $
'post_postcount' => $post_data['post_postcount'],
);
- $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $soft_delete_reason);
+ $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $delete_reason);
$post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
if ($next_post_id === false)
{
- add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $soft_delete_reason);
+ add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $delete_reason);
$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
$message = $user->lang['POST_DELETED'];
}
else
{
- add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $soft_delete_reason);
+ add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $delete_reason);
$meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
$message = $user->lang['POST_DELETED'];
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index de0cccd234..d09f71ae22 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -896,8 +896,7 @@ if (!$get_info)
array('user_regdate', 'users.user_regdate', ''),
array('username', 'users.username', 'phpbb_set_default_encoding'), // recode to utf8 with default lang
array('username_clean', 'users.username', array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_clean_string')),
- array('user_password', 'users.user_password', 'phpbb_hash'),
- array('user_pass_convert', 1, ''),
+ array('user_password', 'users.user_password', 'phpbb_convert_password_hash'),
array('user_posts', 'users.user_posts', 'intval'),
array('user_email', 'users.user_email', 'strtolower'),
array('user_email_hash', 'users.user_email', 'gen_email_hash'),
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 01447a6232..817c007274 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1969,3 +1969,13 @@ function phpbb_add_notification_options($user_notify_pm)
$sql = $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows);
}
+
+function phpbb_convert_password_hash($hash)
+{
+ global $phpbb_container;
+
+ $manager = $phpbb_container->get('passwords.manager');
+ $hash = $manager->hash($hash, '$H$');
+
+ return '$CP$' . $hash;
+}
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 6a91033dbb..5cf01fec79 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -177,11 +177,21 @@ $migrator = $phpbb_container->get('migrator');
$migrator->create_migrations_table();
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
-$finder = $phpbb_extension_manager->get_finder();
-$migrations = $finder
+$migrations = $phpbb_extension_manager
+ ->get_finder()
->core_path('phpbb/db/migration/data/')
+ ->extension_directory('/migration')
->get_classes();
+
+// @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
+$migrations_deprecated = $phpbb_extension_manager
+ ->get_finder()
+ ->extension_directory('/migrations')
+ ->get_classes();
+
+$migrations = array_merge($migrations, $migrations_deprecated);
+
$migrator->set_migrations($migrations);
// What is a safe limit of execution time? Half the max execution time should be safe.
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 2e497da3db..5531a98c09 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -445,7 +445,7 @@ class module
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Pragma: no-cache');
return;
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 2cd6ec59cc..924395ed44 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -93,7 +93,7 @@ $lang = array_merge($lang, array(
'DELETE_POST_PERMANENTLY' => 'Permanently delete this post so it can not be recovered',
'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?',
'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete these posts?',
- 'DELETE_REASON' => 'Soft delete reason',
+ 'DELETE_REASON' => 'Reason for deletion',
'DELETE_REASON_EXPLAIN' => 'The specified reason for deletion will be visible to moderators.',
'DELETE_POST_WARN' => 'Delete this post',
'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?',
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
index c3caae5f70..68638a9515 100644
--- a/phpBB/phpbb/console/command/db/migrate.php
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -117,8 +117,17 @@ class migrate extends \phpbb\console\command\command
$migrations = $this->extension_manager
->get_finder()
->core_path('phpbb/db/migration/data/')
+ ->extension_directory('/migration')
+ ->get_classes();
+
+ // @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
+ $migrations_deprecated = $this->extension_manager
+ ->get_finder()
->extension_directory('/migrations')
->get_classes();
+
+ $migrations = array_merge($migrations, $migrations_deprecated);
+
$this->migrator->set_migrations($migrations);
}
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index dd89d0504a..e2932086db 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -15,6 +15,7 @@ namespace phpbb\controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGenerator;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
/**
@@ -44,6 +45,11 @@ class helper
protected $symfony_request;
/**
+ * @var \phpbb\filesystem The filesystem object
+ */
+ protected $filesystem;
+
+ /**
* phpBB root path
* @var string
*/
@@ -64,15 +70,17 @@ class helper
* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
* @param \phpbb\symfony_request $symfony_request Symfony Request object
+ * @param \phpbb\filesystem $filesystem The filesystem object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
$this->symfony_request = $symfony_request;
+ $this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$provider->find_routing_files($manager->get_finder());
@@ -108,10 +116,11 @@ class helper
* @param string $route Name of the route to travel
* @param array $params String or array of additional url parameters
* @param bool $is_amp Is url using &amp; (true) or & (false)
- * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param bool|string $reference_type The type of reference to be generated (one of the constants)
* @return string The URL already passed through append_sid()
*/
- public function route($route, array $params = array(), $is_amp = true, $session_id = false)
+ public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
{
$anchor = '';
if (isset($params['#']))
@@ -119,27 +128,39 @@ class helper
$anchor = '#' . $params['#'];
unset($params['#']);
}
- $url_generator = new UrlGenerator($this->route_collection, new RequestContext());
- $route_url = $url_generator->generate($route, $params);
- if (strpos($route_url, '/') === 0)
- {
- $route_url = substr($route_url, 1);
- }
+ $context = new RequestContext();
+ $context->fromRequest($this->symfony_request);
+
+ $script_name = $this->symfony_request->getScriptName();
+ $page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);
+
+ $base_url = $context->getBaseUrl();
+
+ // If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it.
+ $base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);
+
+ // We need to update the base url to move to the directory of the app.php file.
+ $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
+
+ $base_url = $this->filesystem->clean_path($base_url);
+
+ $context->setBaseUrl($base_url);
+
+ $url_generator = new UrlGenerator($this->route_collection, $context);
+ $route_url = $url_generator->generate($route, $params, $reference_type);
if ($is_amp)
{
$route_url = str_replace(array('&amp;', '&'), array('&', '&amp;'), $route_url);
}
- // If enable_mod_rewrite is false, we need to include app.php
- $route_prefix = $this->phpbb_root_path;
- if (empty($this->config['enable_mod_rewrite']))
+ if ($reference_type === UrlGeneratorInterface::RELATIVE_PATH && empty($this->config['enable_mod_rewrite']))
{
- $route_prefix .= 'app.' . $this->php_ext . '/';
+ $route_url = 'app.' . $this->php_ext . '/' . $route_url;
}
- return append_sid($route_prefix . $route_url . $anchor, false, $is_amp, $session_id);
+ return append_sid($route_url . $anchor, false, $is_amp, $session_id, true);
}
/**
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 44bea3c5d2..43393a8935 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -129,11 +129,28 @@ class migrator
* Sets the list of available migration class names to the given array.
*
* @param array $class_names An array of migration class names
+ * @param bool $check_fulfillable If TRUE (default), we will check
+ * if all of the migrations are fulfillable after loading them.
+ * If FALSE, we will not check. You SHOULD check at least once
+ * to prevent errors.
* @return null
+ * @throws \phpbb\db\migration\exception
*/
- public function set_migrations($class_names)
+ public function set_migrations($class_names, $check_fulfillable = true)
{
$this->migrations = $class_names;
+
+ if ($check_fulfillable)
+ {
+ foreach ($this->migrations as $name)
+ {
+ $unfulfillable = $this->unfulfillable($name);
+ if ($unfulfillable !== false)
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $unfulfillable);
+ }
+ }
+ }
}
/**
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php
index 288fb7d19c..b74026e6ab 100644
--- a/phpBB/phpbb/extension/base.php
+++ b/phpBB/phpbb/extension/base.php
@@ -35,6 +35,9 @@ class base implements \phpbb\extension\extension_interface
/** @var string */
protected $extension_path;
+ /** @var string[] */
+ private $migrations = false;
+
/**
* Constructor
*
@@ -122,19 +125,27 @@ class base implements \phpbb\extension\extension_interface
*/
protected function get_migration_file_list()
{
- static $migrations = false;
-
- if ($migrations !== false)
+ if ($this->migrations !== false)
{
- return $migrations;
+ return $this->migrations;
}
// Only have the finder search in this extension path directory
$migrations = $this->extension_finder
- ->extension_directory('/migrations')
+ ->extension_directory('/migration')
->find_from_extension($this->extension_name, $this->extension_path);
+
$migrations = $this->extension_finder->get_classes_from_files($migrations);
+ // @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
+ $migrations_deprecated = $this->extension_finder
+ ->extension_directory('/migrations')
+ ->find_from_extension($this->extension_name, $this->extension_path);
+
+ $migrations_deprecated = $this->extension_finder->get_classes_from_files($migrations_deprecated);
+
+ $migrations = array_merge($migrations, $migrations_deprecated);
+
return $migrations;
}
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 4c3d012ca5..18572a3a6c 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -436,9 +436,8 @@ if ($mode == 'delete' || $mode == 'soft_delete')
trigger_error('NO_POST');
}
- $allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id));
- $soft_delete_reason = ($mode == 'soft_delete' && $allow_reason) ? $request->variable('delete_reason', '', true) : '';
- phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $soft_delete_reason);
+ $delete_reason = $request->variable('delete_reason', '', true);
+ phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $delete_reason);
return;
}
@@ -1258,9 +1257,8 @@ if ($submit || $preview || $refresh)
// Handle delete mode...
if ($request->is_set_post('delete') || $request->is_set_post('delete_permanent'))
{
- $allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id));
- $soft_delete_reason = (!$request->is_set_post('delete_permanent') && $allow_reason) ? $request->variable('delete_reason', '', true) : '';
- phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $soft_delete_reason);
+ $delete_reason = $request->variable('delete_reason', '', true);
+ phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $delete_reason);
return;
}
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 13e8d02469..168efff4b4 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -353,14 +353,6 @@ $('.display_post').click(function(e) {
$('#post_hidden' + postId).hide();
});
-$('#delete_permanent').click(function () {
- if ($(this).prop('checked')) {
- $('#delete_reason').hide();
- } else {
- $('#delete_reason').show();
- }
-});
-
/**
* Toggle the member search panel in memberlist.php.
*
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index e9c95aa799..275859ac97 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -22,7 +22,7 @@
<div id="phpbb_alert" class="phpbb_alert" data-l-err="{L_ERROR}" data-l-timeout-processing-req="{L_TIMEOUT_PROCESSING_REQ}">
<a href="#" class="alert_close"></a>
- <h3 class="alert_title"></h3><p class="alert_text"></p>
+ <h3 class="alert_title">&nbsp;</h3><p class="alert_text"></p>
</div>
<div id="phpbb_confirm" class="phpbb_alert">
<a href="#" class="alert_close"></a>
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 1ea5b0973c..7882279485 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -41,7 +41,7 @@
<link href="{T_THEME_PATH}/plupload.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
-<!--[if lte IE 8]>
+<!--[if lte IE 9]>
<link href="{T_THEME_PATH}/tweaks.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen, projection" />
<![endif]-->
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
index cb2c09bff7..4680eaa175 100644
--- a/phpBB/styles/prosilver/template/pagination.html
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -7,7 +7,7 @@
<ul class="dropdown-contents">
<li>{L_JUMP_TO_PAGE}{L_COLON}</li>
<li class="page-jump-form">
- <input type="number" name="page-number" maxlength="6" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
+ <input type="number" name="page-number" min="1" maxlength="6" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
<input class="button2" value="{L_GO}" type="button" />
</li>
</ul>
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 851b3a6bb6..d52ac6dee8 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -1,78 +1,27 @@
/* Style Sheet Tweaks
-These style definitions are IE 7 and 8 specific
-tweaks required due to its poor CSS support.
--------------------------------------------------*/
+These style definitions are IE 8 & 9 only.
+They are required due to the poor CSS support in IE browsers.
+------------------------------------------------------------------------------*/
-/* Clear float fix for IE7 */
-.inner {
- zoom: 1;
-}
+/* IE 8 Tweaks (value)\9 equates to IE <= 8
+------------------------------------------------------------------------------*/
-ul.linklist {
- zoom: 1;
-}
+/* Clear float fix */
+.inner, ul.linklist { zoom: 1\9; }
/* Align checkboxes/radio buttons nicely */
-dd label input {
- vertical-align: text-bottom;
- *vertical-align: middle;
-}
+dd label input { vertical-align: text-bottom\9; }
-/* Simple fix so forum and topic lists always have a height set */
-dl.icon {
- *height: 35px;
-}
+/* Fixes header-avatar aspect-ratio */
+.header-avatar img { height: 20px\9; }
-/* Correctly clear floating for details on profile view */
-dl.details dd {
- *margin-left: 30%;
- *float: none;
-}
-
-/* Headerbar height fix for IE7 */
-#site-description p {
- *margin-bottom: 1.0em;
-}
-
-/* Forum list column styles for IE7 */
-dl.icon dt, dl.icon dd {
- *min-height: 32px;
-}
-
-dd.posts, dd.topics, dd.views, dd.extra, dd.mark {
- *width: 79px;
-}
-
-dd.lastpost, dd.redirect, dd.moderation, dd.time, dd.info {
- *width: 249px;
-}
-
-dd.option {
- *width: 124px;
-}
+/* IE8 often can't handle max-width in %, so we use px instead */
+.postprofile .avatar img { max-width: 150px\9; }
-/* Notifications list for IE7 */
-.dropdown-extended {
- *left: 0;
-}
-.dropdown-extended .header_settings {
- *position: absolute;
- *right: 10px;
- *top: 0;
-}
-.icon-notification {
- *z-index: 2;
-}
+/* IE 9 Tweaks
+------------------------------------------------------------------------------*/
-/* Fixes header-avatar aspect-ratio in IE8 */
-.header-avatar img {
- height: 20px;
-}
-/* IE8 often can't handle max-width in %, so we use px instead */
-.postprofile .avatar img {
- max-width: 150px;
-}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index d186d468df..a1e8c9814b 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -538,13 +538,46 @@ else
}
// Grab just the sorted topic ids
-$sql = 'SELECT t.topic_id
- FROM ' . TOPICS_TABLE . " t
- WHERE $sql_where
+$sql_ary = array(
+ 'SELECT' => 't.topic_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => "$sql_where
AND t.topic_type IN (" . POST_NORMAL . ', ' . POST_STICKY . ")
$sql_approved
- $sql_limit_time
- ORDER BY t.topic_type " . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order;
+ $sql_limit_time",
+ 'ORDER BY' => 't.topic_type ' . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order,
+);
+
+/**
+* Event to modify the SQL query before the topic ids data is retrieved
+*
+* @event core.viewforum_get_topic_ids_data
+* @var array sql_ary SQL query array to get the topic ids data
+* @var string sql_approved Topic visibility SQL string
+* @var int sql_limit Number of records to select
+* @var string sql_limit_time SQL string to limit topic_last_post_time data
+* @var array sql_sort_order SQL sorting string
+* @var int sql_start Offset point to start selection from
+* @var string sql_where SQL WHERE clause string
+* @var bool store_reverse Flag indicating if we select from the late pages
+*
+* @since 3.1.0-RC4
+*/
+$vars = array(
+ 'sql_ary',
+ 'sql_approved',
+ 'sql_limit',
+ 'sql_limit_time',
+ 'sql_sort_order',
+ 'sql_start',
+ 'sql_where',
+ 'store_reverse',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_ids_data', compact($vars)));
+
+$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while ($row = $db->sql_fetchrow($result))