Merge branch 'MAINT_4_5_4' into MAINT_4_5_4-security

This commit is contained in:
Michal Čihař 2016-01-25 12:23:23 +01:00
commit 671d618304
11 changed files with 60 additions and 10 deletions

View File

@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog
- issue #11752 Improve detection of privileges for privilege adjusting
- issue #11854 Undefined property: stdClass::$releases at version check when disabled in config
- issue #11814 SQL comment and variable stripped from bookmark on save
- issue Gracefully handle errors in regex based javascript search
4.5.3.1 (2015-12-25)
- issue #11774 Undefined offset 2

View File

@ -17,6 +17,10 @@ if (! PMA_DRIZZLE) {
}
require 'libraries/build_html_for_db.lib.php';
if (! isset($_POST['new_db'])) {
PMA_Util::checkParameters(array('new_db'));
}
/**
* Defines the url to return to in case of error in a sql statement
*/

View File

@ -81,6 +81,8 @@ if (isset($_REQUEST['operation'])) {
return;
}
require 'libraries/db_common.inc.php';
$script_display_field = PMA_getTablesInfo();
$tab_column = PMA_getColumnsInfo();
$script_tables = PMA_getScriptTabs();
@ -126,8 +128,6 @@ $scripts->addFile('pmd/move.js');
$scripts->addFile('pmd/iecanvas.js', true);
$scripts->addFile('pmd/init.js');
require 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,

View File

@ -43,6 +43,7 @@ if (!defined('TESTSUITE')) {
$post_params = array(
'db',
'table',
'what',
'single_table',
'export_type',
'export_method',
@ -163,11 +164,12 @@ if (!defined('TESTSUITE')) {
}
$table = $GLOBALS['table'];
// sanitize this parameter which will be used below in a file inclusion
$what = PMA_securePath($_POST['what']);
PMA_Util::checkParameters(array('what', 'export_type'));
// sanitize this parameter which will be used below in a file inclusion
$what = PMA_securePath($_POST['what']);
// export class instance, not array of properties, as before
/* @var $export_plugin ExportPlugin */
$export_plugin = PMA_getPlugin(

View File

@ -23,6 +23,10 @@ require_once 'libraries/common.inc.php';
require_once 'libraries/gis/GIS_Factory.class.php';
require_once 'libraries/gis/GIS_Visualization.class.php';
if (! isset($_REQUEST['field'])) {
PMA_Util::checkParameters(array('field'));
}
// Get data if any posted
$gis_data = array();
if (PMA_isValid($_REQUEST['gis_data'], 'array')) {
@ -185,6 +189,9 @@ if ($geom_type == 'GEOMETRYCOLLECTION') {
}
for ($a = 0; $a < $geom_count; $a++) {
if (! isset($gis_data[$a])) {
continue;
}
if ($geom_type == 'GEOMETRYCOLLECTION') {
echo '<br/><br/>';

View File

@ -1695,7 +1695,15 @@ AJAX.registerOnload('server_status_monitor.js', function () {
if (val.length === 0) {
textFilter = null;
} else {
textFilter = new RegExp(val, 'i');
try {
textFilter = new RegExp(val, 'i');
$('#filterQueryText').removeClass('error');
} catch(e) {
if (e instanceof SyntaxError) {
$('#filterQueryText').addClass('error');
textFilter = null;
}
}
}
var rowSum = 0, totalSum = 0, i = 0, q;

View File

@ -48,7 +48,15 @@ AJAX.registerOnload('server_status_variables.js', function () {
if (word.length === 0) {
textFilter = null;
} else {
textFilter = new RegExp("(^| )" + word, 'i');
try {
textFilter = new RegExp("(^| )" + word, 'i');
$(this).removeClass('error');
} catch(e) {
if (e instanceof SyntaxError) {
$(this).addClass('error');
textFilter = null;
}
}
}
text = word;
filterVariables();

View File

@ -30,7 +30,15 @@ AJAX.registerOnload('server_variables.js', function () {
$filterField.keyup(function () {
var textFilter = null, val = $(this).val();
if (val.length !== 0) {
textFilter = new RegExp("(^| )" + val.replace(/_/g, ' '), 'i');
try {
textFilter = new RegExp("(^| )" + val.replace(/_/g, ' '), 'i');
$(this).removeClass('error');
} catch(e) {
if (e instanceof SyntaxError) {
$(this).addClass('error');
textFilter = null;
}
}
}
filterVariables(textFilter);
});

View File

@ -1093,6 +1093,11 @@ function PMA_countQueryResults(
$num_rows, $justBrowsing, $db, $table, $analyzed_sql_results
) {
/* Shortcut for not analyzed/empty query */
if (empty($analyzed_sql_results)) {
return 0;
}
if (!PMA_isAppendLimitClause($analyzed_sql_results)) {
// if we did not append a limit, set this to get a correct
// "Showing rows..." message
@ -2029,7 +2034,8 @@ function PMA_executeQueryAndGetQueryResponse($analyzed_sql_results,
// (the parser never sets the 'union' key to 0).
// Handling is also not required if we came from the "Sort by key"
// drop-down.
if (PMA_isRememberSortingOrder($analyzed_sql_results)
if (! empty($analyzed_sql_results)
&& PMA_isRememberSortingOrder($analyzed_sql_results)
&& empty($analyzed_sql_results['union'])
&& ! isset($_REQUEST['sort_by_key'])
) {

View File

@ -22,6 +22,10 @@ require_once 'libraries/Index.class.php';
require_once 'libraries/pmd_common.php';
require_once 'libraries/plugin_interface.lib.php';
if (! isset($_REQUEST['export_type'])) {
PMA_Util::checkParameters(array('export_type'));
}
/**
* Include the appropriate Schema Class depending on $export_type
* default is PDF

View File

@ -69,9 +69,11 @@ class PMA_Operations_Test extends PHPUnit_Framework_TestCase
{
$_REQUEST['db_collation'] = 'db1';
$html = PMA_getHtmlForRenameDatabase("pma");
$this->assertContains('db_operations.php', $html);
$this->assertRegExp(
'/.*db_operations.php(.|[\n])*db_rename([\n]|.)*Rename database to.*/m',
PMA_getHtmlForRenameDatabase("pma")
'/.*db_rename.*Rename database to.*/',
$html
);
}