Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-09-08 22:40:10 +02:00
commit 606eade2e2
3 changed files with 18 additions and 4 deletions

View File

@ -62,6 +62,8 @@ phpMyAdmin - ChangeLog
- [export] Remove native Excel export modules (xls and xlsx formats)
- [import] Remove native Excel import modules (xls and xlsx formats)
- bug #3392920 [edit] BLOB emptied after editing another column
- [security] Fixed XSS in Inline Edit on save action, see PMASA-2011-14
- [security] Fixed XSS with db/table/column names, see PMASA-2011-14
3.4.4.0 (2011-08-24)
- bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes

View File

@ -199,7 +199,7 @@ function selectContent( element, lock, only_once )
}
/**
* Displays a confirmation box before to submit a "DROP/DELETE/ALTER" query.
* Displays a confirmation box before submitting a "DROP/DELETE/ALTER" query.
* This function is called while clicking links
*
* @param object the link
@ -2246,7 +2246,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP DATABASE ' + window.parent.db;
var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP DATABASE ' + escapeHtml(window.parent.db);
$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {
@ -3374,3 +3374,15 @@ function PMA_clearSelection() {
if(sel.removeAllRanges) sel.removeAllRanges();
}
}
/**
* HTML escaping
*/
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}

View File

@ -44,7 +44,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + curr_table_name + '` DROP `' + curr_column_name + '`';
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`';
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@ -83,7 +83,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + curr_table_name + '` ADD PRIMARY KEY(`' + curr_column_name + '`)';
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` ADD PRIMARY KEY(`' + escapeHtml(curr_column_name) + '`)';
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {