mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/security-283] Unify behavior between adm and prosilver, clean up
SECURITY-283
This commit is contained in:
parent
c3bb5e1bec
commit
17480d7d07
3 changed files with 33 additions and 19 deletions
|
@ -121,8 +121,8 @@ function parse_document(container)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((text.length && text !== '-') || cell.children().length) {
|
if ((text.length && text !== '-') || cell.children().length) {
|
||||||
if (headers[column] != '') {
|
if (headers[column].length) {
|
||||||
cell.prepend('<dfn style="display: none;">' + headers[column] + '</dfn>');
|
cell.prepend($("<dfn>").css('display', 'none').text(headers[column]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -143,7 +143,7 @@ function parse_document(container)
|
||||||
*/
|
*/
|
||||||
container.find('table.responsive > tbody').each(function() {
|
container.find('table.responsive > tbody').each(function() {
|
||||||
var items = $(this).children('tr');
|
var items = $(this).children('tr');
|
||||||
if (items.length == 0)
|
if (!items.length)
|
||||||
{
|
{
|
||||||
$(this).parent('table:first').addClass('responsive-hide');
|
$(this).parent('table:first').addClass('responsive-hide');
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ function parse_document(container)
|
||||||
var width = $body.width(),
|
var width = $body.width(),
|
||||||
height = $this.height();
|
height = $this.height();
|
||||||
|
|
||||||
if (arguments.length == 0 && (!responsive || width <= lastWidth) && height <= maxHeight) {
|
if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,14 +235,20 @@ function submitPermissions() {
|
||||||
if ($alertBoxLink) {
|
if ($alertBoxLink) {
|
||||||
// Remove forum_id[] from URL
|
// Remove forum_id[] from URL
|
||||||
$alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, ''));
|
$alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, ''));
|
||||||
var previousPageForm = '<form action="' + $alertBoxLink.attr('href') + '" method="post">';
|
const $previousPageForm = $('<form>').attr({
|
||||||
$.each(forumIds, function (key, value) {
|
action: $alertBoxLink.attr('href'),
|
||||||
previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
method: 'post'
|
||||||
|
});
|
||||||
|
|
||||||
|
$.each(forumIds, function (key, value) {
|
||||||
|
$previousPageForm.append($('<input>').attr({
|
||||||
|
type: 'text',
|
||||||
|
name: 'forum_id[]',
|
||||||
|
value: value
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
previousPageForm += '</form>';
|
|
||||||
|
|
||||||
$alertBoxLink.on('click', function (e) {
|
$alertBoxLink.on('click', function (e) {
|
||||||
var $previousPageForm = $(previousPageForm);
|
|
||||||
$('body').append($previousPageForm);
|
$('body').append($previousPageForm);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$previousPageForm.submit();
|
$previousPageForm.submit();
|
||||||
|
@ -257,12 +263,19 @@ function submitPermissions() {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
// Create forum to submit using POST. This will prevent
|
// Create forum to submit using POST. This will prevent
|
||||||
// exceeding the maximum length of URLs
|
// exceeding the maximum length of URLs
|
||||||
var form = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, '') + '" method="post">';
|
const $form = $('<form>').attr({
|
||||||
$.each(forumIds, function (key, value) {
|
action: res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, ''),
|
||||||
form += '<input type="text" name="forum_id[]" value="' + value + '" />';
|
method: 'post'
|
||||||
});
|
});
|
||||||
form += '</form>';
|
|
||||||
$form = $(form);
|
$.each(forumIds, function (key, value) {
|
||||||
|
$form.append($('<input>').attr({
|
||||||
|
type: 'text',
|
||||||
|
name: 'forum_id[]',
|
||||||
|
value: value
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
$('body').append($form);
|
$('body').append($form);
|
||||||
|
|
||||||
// Hide the alert even if we refresh the page, in case the user
|
// Hide the alert even if we refresh the page, in case the user
|
||||||
|
|
|
@ -773,8 +773,9 @@ function parseDocument($container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((text.length && text !== '-') || cell.children().length) {
|
if ((text.length && text !== '-') || cell.children().length) {
|
||||||
const $dfnElement = $("<dfn>").css('display', 'none').text(headers[column]);
|
if (headers[column].length) {
|
||||||
cell.prepend($dfnElement);
|
cell.prepend($("<dfn>").css('display', 'none').text(headers[column]));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cell.addClass('empty');
|
cell.addClass('empty');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue