diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000000..26e5b57d8a --- /dev/null +++ b/.jshintrc @@ -0,0 +1,22 @@ +{ + // Show more errors + "maxerr" : 1000, + + // Globals + "jquery" : true, + + // Stricter checking + "curly" : true, + "immed" : true, + "indent" : 4, + "latedef" : true, + "noarg" : true, + "noempty" : true, + "unused" : false, + "trailing" : true, + + // Relaxing rules + "sub" : false, + "funcscope" : false, + "laxbreak" : false +} diff --git a/ChangeLog b/ChangeLog index cf606ae8ed..0cdaad4722 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ phpMyAdmin - ChangeLog 4.1.0.0 (not yet released) +4.0.1.0 (not yet released) +- bug #3879 Import broken for CSV using LOAD DATA + 4.0.0.0 (not yet released) + Patch #3481047 for rfe #3480477 Insert as new row enhancement + Patch #3480999 Activate codemirror in the query window @@ -106,9 +109,23 @@ underscore - bug #3865 Using like operator on each backslash needs 4 backslash protection - bug #3860 Displayed git revision info is not set - bug #3871 Check referential integrity broken across databases +- bug #3874 [export] No preselected option when exporting table +- bug #3873 Can't copy table to target database if table exists there +- bug #3683 Incorrect listing of records from to count +- bug #3876 [import] PHP 5.2 - unexpected T_PAAMAYIM_NEKUDOTAYIM +- [security] Local file inclusion vulnerability, reported by Janek Vind + (see PMASA-2013-4) +- [security] Global variables overwrite in export.php, reported by Janek Vind + (see PMASA-2013-5) 3.5.9.0 (not yet released) +3.5.8.1 (2013-04-24) +- [security] Remote code execution (preg_replace), reported by Janek Vind + (see PMASA-2013-2) +- [security] Locally Saved SQL Dump File Multiple File Extension Remote Code + Execution, reported by Janek Vind (see PMASA-2013-3) + 3.5.8.0 (2013-04-08) - bug #3828 MariaDB reported as MySQL - bug #3854 Incorrect header for Safari 6.0 diff --git a/browse_foreigners.php b/browse_foreigners.php index 8cdc7728b0..87a214f4e3 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -163,7 +163,7 @@ if (isset($rownumber)) { . htmlspecialchars($rownumber) . '" />'; } $output .= '' - . '' + . '' . '' . ' - + @@ -107,7 +107,7 @@ - + diff --git a/db_datadict.php b/db_datadict.php index 8744aa4a05..8f8b8528ac 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -154,7 +154,7 @@ foreach ($tables as $table) { * Displays the comments of the table if MySQL >= 3.23 */ if (!empty($show_comment)) { - echo __('Table comments') . ': ' . htmlspecialchars($show_comment) . '

'; + echo __('Table comments:') . ' ' . htmlspecialchars($show_comment) . '

'; } /** diff --git a/db_printview.php b/db_printview.php index e0c2f14234..209d1286de 100644 --- a/db_printview.php +++ b/db_printview.php @@ -182,7 +182,7 @@ if ($num_tables == 0) { if (! empty($sts_data['Create_time'])) { ?> - + - + - + $one_post_value) { - $GLOBALS[$one_post_param] = $one_post_value; +$post_params = array( + 'db', + 'table', + 'single_table', + 'export_type', + 'export_method', + 'quick_or_custom', + 'limit_to', + 'limit_from', + 'allrows', + 'output_format', + 'filename_template', + 'remember_template', + 'charset_of_file', + 'compression', + 'what', + 'htmlword_structure_or_data', + 'htmlword_null', + 'htmlword_columns', + 'mediawiki_structure_or_data', + 'mediawiki_caption', + 'pdf_report_title', + 'pdf_structure_or_data', + 'odt_structure_or_data', + 'odt_relation', + 'odt_comments', + 'odt_mime', + 'odt_columns', + 'odt_null', + 'codegen_structure_or_data', + 'codegen_format', + 'excel_null', + 'excel_columns', + 'excel_edition', + 'excel_structure_or_data', + 'yaml_structure_or_data', + 'ods_null', + 'ods_structure_or_data', + 'ods_columns', + 'json_structure_or_data', + 'xml_structure_or_data', + 'xml_export_functions', + 'xml_export_procedures', + 'xml_export_tables', + 'xml_export_triggers', + 'xml_export_views', + 'xml_export_contents', + 'texytext_structure_or_data', + 'texytext_columns', + 'texytext_null', + 'phparray_structure_or_data', + 'sql_include_comments', + 'sql_header_comment', + 'sql_dates', + 'sql_relation', + 'sql_mime', + 'sql_use_transaction', + 'sql_disable_fk', + 'sql_compatibility', + 'sql_structure_or_data', + 'sql_drop_table', + 'sql_procedure_function', + 'sql_create_table_statements', + 'sql_if_not_exists', + 'sql_auto_increment', + 'sql_backquotes', + 'sql_truncate', + 'sql_delayed', + 'sql_ignore', + 'sql_type', + 'sql_insert_syntax', + 'sql_max_query_size', + 'sql_hex_for_blob', + 'sql_utc_time', + 'csv_separator', + 'csv_enclosed', + 'csv_escaped', + 'csv_terminated', + 'csv_null', + 'csv_columns', + 'csv_structure_or_data', + 'latex_caption', + 'latex_structure_or_data', + 'latex_structure_caption', + 'latex_structure_continued_caption', + 'latex_structure_label', + 'latex_relation', + 'latex_comments', + 'latex_mime', + 'latex_columns', + 'latex_data_caption', + 'latex_data_continued_caption', + 'latex_data_label', + 'latex_null' +); + +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } } +// sanitize this parameter which will be used below in a file inclusion +$what = PMA_securePath($what); + PMA_Util::checkParameters(array('what', 'export_type')); // export class instance, not array of properties, as before @@ -352,7 +456,9 @@ if ($asfile) { } } $filename = PMA_Util::expandUserString($filename_template); - $filename = PMA_sanitizeFilename($filename); + // remove dots in filename (coming from either the template or already + // part of the filename) to avoid a remote code execution vulnerability + $filename = PMA_sanitizeFilename($filename, $replaceDots = true); // Grab basic dump extension and mime type // Check if the user already added extension; diff --git a/gis_data_editor.php b/gis_data_editor.php index 229e36bdbe..89c46b90fc 100644 --- a/gis_data_editor.php +++ b/gis_data_editor.php @@ -158,7 +158,7 @@ foreach ($gis_types as $gis_type) { } echo ''; echo '    '; -echo ''; +echo ''; echo ''; echo ''; echo ''; @@ -181,7 +181,7 @@ for ($a = 0; $a < $geom_count; $a++) { if ($geom_type == 'GEOMETRYCOLLECTION') { echo '

'; - echo __("Geometry") . ' ' . ($a + 1) . ': '; + printf(__('Geometry %d:'), $a + 1); echo '
'; if (isset($gis_data[$a]['gis_type'])) { $type = $gis_data[$a]['gis_type']; @@ -203,7 +203,7 @@ for ($a = 0; $a < $geom_count; $a++) { if ($type == 'POINT') { echo '
'; - echo __("Point") . ': '; + echo __('Point:'); echo ''; echo ''; @@ -259,12 +259,12 @@ for ($a = 0; $a < $geom_count; $a++) { for ($i = 0; $i < $no_of_lines; $i++) { echo '
'; if ($type == 'MULTILINESTRING') { - echo __("Linestring") . ' ' . ($i + 1) . ':'; + printf(__('Linestring %d:'), $i + 1); } else { if ($i == 0) { - echo __("Outer Ring") . ':'; + echo __('Outer ring:'); } else { - echo __("Inner Ring") . ' ' . $i . ':'; + printf(__('Inner ring %d:'), $i); } } @@ -322,7 +322,7 @@ for ($a = 0; $a < $geom_count; $a++) { for ($k = 0; $k < $no_of_polygons; $k++) { echo '
'; - echo __("Polygon") . ' ' . ($k + 1) . ':'; + printf(__('Polygon %d:'), $k + 1); $no_of_lines = isset($gis_data[$a][$type][$k]['no_of_lines']) ? $gis_data[$a][$type][$k]['no_of_lines'] : 1; if ($no_of_lines < 1) { @@ -338,9 +338,9 @@ for ($a = 0; $a < $geom_count; $a++) { for ($i = 0; $i < $no_of_lines; $i++) { echo '

'; if ($i == 0) { - echo __("Outer Ring") . ':'; + echo __('Outer ring:'); } else { - echo __("Inner Ring") . ' ' . $i . ':'; + printf(__('Inner ring %d:'), $i); } $no_of_points = isset($gis_data[$a][$type][$k][$i]['no_of_points']) diff --git a/import.php b/import.php index 78f238730c..09272e7231 100644 --- a/import.php +++ b/import.php @@ -474,7 +474,8 @@ if (! $error) { $import_plugin = PMA_getPlugin( "import", $format, - 'libraries/plugins/import/' + 'libraries/plugins/import/', + $import_type ); if ($import_plugin == null) { $error = true; diff --git a/index.php b/index.php index 7789cc461c..eb8bba346d 100644 --- a/index.php +++ b/index.php @@ -152,7 +152,7 @@ if ($server > 0 echo '
' . "\n" . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') . '