From a8caf74fdafdce6b65a411635593f2347ae984ae Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 Jun 2011 12:18:57 -0400 Subject: [PATCH 1/8] 3.4.3-rc1 --- Documentation.html | 4 ++-- README | 2 +- libraries/Config.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation.html b/Documentation.html index 6146f216bb..fb2a8819f9 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.3-dev - Documentation + phpMyAdmin 3.4.3-rc1 - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index d3da4f92fc..53a08eb4b0 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.3-dev +Version 3.4.3-rc1 A set of PHP-scripts to manage MySQL over the web. diff --git a/libraries/Config.class.php b/libraries/Config.class.php index d426b53388..7081f83942 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.3-dev'); + $this->set('PMA_VERSION', '3.4.3-rc1'); /** * @deprecated */ From 7ecb1abaa49142a7e0b3f6d6e37cb4855e17ddf9 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 Jun 2011 12:21:11 -0400 Subject: [PATCH 2/8] 3.4.4-dev --- ChangeLog | 2 ++ Documentation.html | 4 ++-- README | 2 +- libraries/Config.class.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3a7ff679e..9bb28a813c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ phpMyAdmin - ChangeLog ====================== +3.4.4.0 (not yet released) + 3.4.3.0 (not yet released) - bug #3311170 [sync] Missing helper icons in Synchronize - patch #3304473 [setup] Redefine a lable that was wrong diff --git a/Documentation.html b/Documentation.html index 6146f216bb..23efaa9548 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.3-dev - Documentation + phpMyAdmin 3.4.4-dev - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index d3da4f92fc..06955517ff 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.3-dev +Version 3.4.4-dev A set of PHP-scripts to manage MySQL over the web. diff --git a/libraries/Config.class.php b/libraries/Config.class.php index d426b53388..f9e10f039a 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.3-dev'); + $this->set('PMA_VERSION', '3.4.4-dev'); /** * @deprecated */ From 40ddb5031e4c404a53c6f08ffbe16e073305d895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 21 Jun 2011 11:31:42 +0200 Subject: [PATCH 3/8] Docblocks and whitespace cleanup in export modules --- libraries/export/csv.php | 2 ++ libraries/export/excel.php | 12 +++++------ libraries/export/htmlword.php | 2 +- libraries/export/json.php | 3 +++ libraries/export/latex.php | 2 +- libraries/export/mediawiki.php | 13 ++++++------ libraries/export/php_array.php | 3 ++- libraries/export/xls.php | 38 +++++++++++++++++----------------- libraries/export/xlsx.php | 2 +- libraries/export/xml.php | 1 - 10 files changed, 41 insertions(+), 37 deletions(-) diff --git a/libraries/export/csv.php b/libraries/export/csv.php index 41c3cf39d7..050db6c7c7 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -1,6 +1,8 @@ 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array( - 'type' => 'select', - 'name' => 'edition', + 'type' => 'select', + 'name' => 'edition', 'values' => array( 'win' => 'Windows', - 'mac_excel2003' => 'Excel 2003 / Macintosh', - 'mac_excel2008' => 'Excel 2008 / Macintosh'), + 'mac_excel2003' => 'Excel 2003 / Macintosh', + 'mac_excel2008' => 'Excel 2008 / Macintosh'), 'text' => __('Excel edition:')), array('type' => 'hidden', 'name' => 'structure_or_data'), array('type' => 'end_group'), diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 7b544764e9..6598873d29 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -1,7 +1,7 @@ setTempDir(realpath($GLOBALS['cfg']['TempDir'])); $workbookWriter->save($tmp_filename); - + if (!PMA_exportOutputHandler(file_get_contents($tmp_filename))) { return false; } - + unlink($tmp_filename); - + unset($GLOBALS['workbook']); unset($GLOBALS['sheet_index']); @@ -84,17 +84,17 @@ function PMA_exportFooter() { */ function PMA_exportHeader() { global $db; - + /* Initialize the workbook */ $GLOBALS['workbook'] = new PHPExcel(); $GLOBALS['sheet_index'] = 0; global $workbook; - + $workbook->getProperties()->setCreator('phpMyAdmin ' . PMA_VERSION); $workbook->getProperties()->setLastModifiedBy('phpMyAdmin ' . PMA_VERSION); $workbook->getProperties()->setTitle($db); $workbook->getProperties()->setSubject('phpMyAdmin ' . PMA_VERSION . ' XLS Dump'); - + return true; } @@ -108,8 +108,8 @@ function PMA_exportHeader() { * @access public */ function PMA_exportDBHeader($db) { - - + + return true; } @@ -155,33 +155,33 @@ function PMA_exportDBCreate($db) { function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { global $workbook; global $sheet_index; - + /** * Get the data from the database using the original query */ $result = PMA_DBI_fetch_result($sql_query); $row_cnt = count($result); - + if ($row_cnt > 0) { $col_names = array_keys($result[0]); $fields_cnt = count($result[0]); $row_offset = 1; - + /* Only one sheet is created on workbook initialization */ if ($sheet_index > 0) { $workbook->createSheet(); } - + $workbook->setActiveSheetIndex($sheet_index); $workbook->getActiveSheet()->setTitle(substr($table, 0, 31)); - + if (isset($GLOBALS['xls_columns']) && $GLOBALS['xls_columns']) { for ($i = 0; $i < $fields_cnt; ++$i) { $workbook->getActiveSheet()->setCellValueByColumnAndRow($i, $row_offset, $col_names[$i]); } $row_offset++; } - + for ($r = 0; ($r < 65536) && ($r < $row_cnt); ++$r) { for ($c = 0; $c < $fields_cnt; ++$c) { if (!isset($result[$r][$col_names[$c]]) || is_null($result[$r][$col_names[$c]])) { @@ -196,10 +196,10 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { } } } - + $sheet_index++; } - + return true; } diff --git a/libraries/export/xlsx.php b/libraries/export/xlsx.php index 190cd2f1e5..db65add198 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -1,7 +1,7 @@ Date: Tue, 21 Jun 2011 11:34:06 +0200 Subject: [PATCH 4/8] Add phpdoc --- themes/svg_gradient.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/svg_gradient.php b/themes/svg_gradient.php index a5d89c61a4..c8f9ae89f4 100644 --- a/themes/svg_gradient.php +++ b/themes/svg_gradient.php @@ -1,4 +1,9 @@ Date: Tue, 21 Jun 2011 11:39:21 +0200 Subject: [PATCH 5/8] Use subpackages for export formats --- libraries/export/codegen.php | 6 ++++-- libraries/export/csv.php | 3 ++- libraries/export/excel.php | 3 ++- libraries/export/htmlword.php | 3 ++- libraries/export/json.php | 3 ++- libraries/export/latex.php | 3 ++- libraries/export/mediawiki.php | 3 ++- libraries/export/ods.php | 3 ++- libraries/export/odt.php | 3 ++- libraries/export/pdf.php | 6 ++++-- libraries/export/php_array.php | 3 ++- libraries/export/sql.php | 3 ++- libraries/export/texytext.php | 3 ++- libraries/export/xls.php | 3 ++- libraries/export/xlsx.php | 3 ++- libraries/export/xml.php | 3 ++- libraries/export/yaml.php | 3 ++- 17 files changed, 38 insertions(+), 19 deletions(-) diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php index 56c9d08572..bb4510a480 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -3,7 +3,8 @@ /** * Set of functions used to build NHibernate dumps of tables * - * @package phpMyAdmin-Export-Codegen + * @package phpMyAdmin-Export + * @subpackage Codegen */ if (! defined('PHPMYADMIN')) { exit; @@ -148,7 +149,8 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) /** * - * @package phpMyAdmin-Export-Codegen + * @package phpMyAdmin-Export + * @subpackage Codegen */ class TableProperty { diff --git a/libraries/export/csv.php b/libraries/export/csv.php index 050db6c7c7..62b1537375 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -3,7 +3,8 @@ /** * CSV export code * - * @package phpMyAdmin-Export-CSV + * @package phpMyAdmin-Export + * @subpackage CSV */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/excel.php b/libraries/export/excel.php index 5afbd7e154..df329de1b0 100644 --- a/libraries/export/excel.php +++ b/libraries/export/excel.php @@ -3,7 +3,8 @@ /** * Set of functions used to build CSV dumps of tables for excel * - * @package phpMyAdmin-Export-CSV-Excel + * @package phpMyAdmin-Export + * @subpackage CSV-Excel */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 6598873d29..af5af76546 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -3,7 +3,8 @@ /** * Set of functions used to build HTML dumps of tables * - * @package phpMyAdmin-Export-HTMLWord + * @package phpMyAdmin-Export + * @subpackage HTMLWord */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/json.php b/libraries/export/json.php index d45c01b8a0..c9bba1e7d7 100644 --- a/libraries/export/json.php +++ b/libraries/export/json.php @@ -3,7 +3,8 @@ /** * Set of functions used to build dumps of tables as JSON * - * @package phpMyAdmin-Export-JSON + * @package phpMyAdmin-Export + * @subpackage JSON */ */ if (! defined('PHPMYADMIN')) { diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 01e7ea10b7..565c29cba2 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -3,7 +3,8 @@ /** * Set of functions used to build LaTeX dumps of tables * - * @package phpMyAdmin-Export-Latex + * @package phpMyAdmin-Export + * @subpackage Latex */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/mediawiki.php b/libraries/export/mediawiki.php index 2363979221..538c31c533 100644 --- a/libraries/export/mediawiki.php +++ b/libraries/export/mediawiki.php @@ -3,7 +3,8 @@ /** * Set of functions used to build MediaWiki dumps of tables * - * @package phpMyAdmin-Export-MediaWiki + * @package phpMyAdmin-Export + * @subpackage MediaWiki */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/ods.php b/libraries/export/ods.php index 0237627e48..699aa0fa2e 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -3,7 +3,8 @@ /** * Set of functions used to build OpenDocument Spreadsheet dumps of tables * - * @package phpMyAdmin-Export-ODS + * @package phpMyAdmin-Export + * @subpackage ODS */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 2210a1213d..d3c42de6b1 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -3,7 +3,8 @@ /** * Set of functions used to build OpenDocument Text dumps of tables * - * @package phpMyAdmin-Export-ODT + * @package phpMyAdmin-Export + * @subpackage ODT */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php index fe9b46c874..e864454b64 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -3,7 +3,8 @@ /** * Produce a PDF report (export) from a query * - * @package phpMyAdmin-Export-PDF + * @package phpMyAdmin-Export + * @subpackage PDF */ if (! defined('PHPMYADMIN')) { exit; @@ -39,7 +40,8 @@ require_once './libraries/tcpdf/tcpdf.php'; /** * Adapted from a LGPL script by Philip Clarke - * @package phpMyAdmin-Export-PDF + * @package phpMyAdmin-Export + * @subpackage PDF */ class PMA_PDF extends TCPDF { diff --git a/libraries/export/php_array.php b/libraries/export/php_array.php index 2687eb7bbb..66a0aa6070 100644 --- a/libraries/export/php_array.php +++ b/libraries/export/php_array.php @@ -3,7 +3,8 @@ /** * Set of functions used to build dumps of tables as PHP Arrays * - * @package phpMyAdmin-Export-PHP + * @package phpMyAdmin-Export + * @subpackage PHP */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/sql.php b/libraries/export/sql.php index b1bd4579b1..ed61a07d1d 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -3,7 +3,8 @@ /** * Set of functions used to build SQL dumps of tables * - * @package phpMyAdmin-Export-SQL + * @package phpMyAdmin-Export + * @subpackage SQL */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index d15b43e1c3..2b290f1725 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -3,7 +3,8 @@ /** * Export to Texy! text. * - * @package phpMyAdmin-Export-Texy + * @package phpMyAdmin-Export + * @subpackage Texy */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/xls.php b/libraries/export/xls.php index 4461c2ec0a..2a1f2192a7 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -3,7 +3,8 @@ /** * Set of functions used to build dumps of tables as Excel files. * - * @package phpMyAdmin-Export-XLS + * @package phpMyAdmin-Export + * @subpackage XLS */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/xlsx.php b/libraries/export/xlsx.php index db65add198..487c2dfb59 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -3,7 +3,8 @@ /** * Set of functions used to build dumps of tables as Excel 2007 files. * - * @package phpMyAdmin-Export-XLSX + * @package phpMyAdmin-Export + * @subpackage XLSX */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/xml.php b/libraries/export/xml.php index de2d12aff2..ba1e4fa12f 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -3,7 +3,8 @@ /** * Set of functions used to build XML dumps of tables * - * @package phpMyAdmin-Export-XML + * @package phpMyAdmin-Export + * @subpackage XML */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index 9d9f7e5b87..8c3fad045d 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -3,7 +3,8 @@ /** * Set of functions used to build YAML dumps of tables * - * @package phpMyAdmin-Export-YAML + * @package phpMyAdmin-Export + * @subpackage YAML */ if (! defined('PHPMYADMIN')) { exit; From ffc01b199aa99744a4b21d7b3bdfb24c593bb314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 21 Jun 2011 11:41:05 +0200 Subject: [PATCH 6/8] Define subpackages for import modules --- libraries/import/csv.php | 1 + libraries/import/docsql.php | 1 + libraries/import/ldi.php | 3 ++- libraries/import/ods.php | 2 +- libraries/import/sql.php | 7 ++++--- libraries/import/xls.php | 17 ++++++++-------- libraries/import/xlsx.php | 17 ++++++++-------- libraries/import/xml.php | 40 ++++++++++++++++++------------------- 8 files changed, 47 insertions(+), 41 deletions(-) diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 6386333184..49cff44208 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -5,6 +5,7 @@ * * @todo add an option for handling NULL values * @package phpMyAdmin-Import + * @subpackage CSV */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index f032e95577..3ac799f063 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -4,6 +4,7 @@ * DocSQL import plugin for phpMyAdmin * * @package phpMyAdmin-Import + * @subpackage DocSQL */ if (! defined('PHPMYADMIN')) { exit; diff --git a/libraries/import/ldi.php b/libraries/import/ldi.php index 979013dec0..56dabf90d5 100644 --- a/libraries/import/ldi.php +++ b/libraries/import/ldi.php @@ -1,9 +1,10 @@ 'bool', - 'name' => 'no_auto_value_on_zero', + 'type' => 'bool', + 'name' => 'no_auto_value_on_zero', 'text' => __('Do not use AUTO_INCREMENT for zero values'), 'doc' => array( 'manual_MySQL_Database_Administration', @@ -234,7 +235,7 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) { } // Skip the rest $start_of_comment = $i; - // do not use PHP_EOL here instead of "\n", because the export + // do not use PHP_EOL here instead of "\n", because the export // file might have been produced on a different system $i = strpos($buffer, $ch == '/' ? '*/' : "\n", $i); // didn't we hit end of string? diff --git a/libraries/import/xls.php b/libraries/import/xls.php index 6d5c0e2182..f7e3d33ced 100644 --- a/libraries/import/xls.php +++ b/libraries/import/xls.php @@ -5,6 +5,7 @@ * * @todo Pretty much everything * @package phpMyAdmin-Import + * @subpackage XLS */ if (! defined('PHPMYADMIN')) { @@ -54,26 +55,26 @@ $col_names = array(); for ($s = 0; $s < $num_sheets; ++$s) { $current_sheet = $objPHPExcel->getSheet($s); - + $num_rows = $current_sheet->getHighestRow(); $num_cols = PMA_getColumnNumberFromName($current_sheet->getHighestColumn()); - + if ($num_rows != 1 && $num_cols != 1) { for ($r = 1; $r <= $num_rows; ++$r) { for ($c = 0; $c < $num_cols; ++$c) { $cell = $current_sheet->getCellByColumnAndRow($c, $r)->getCalculatedValue(); - + if (! strcmp($cell, '')) { $cell = 'NULL'; } - + $tempRow[] = $cell; } - + $rows[] = $tempRow; $tempRow = array(); } - + if ($_REQUEST['xls_col_names']) { $col_names = array_splice($rows, 0, 1); $col_names = $col_names[0]; @@ -87,9 +88,9 @@ for ($s = 0; $s < $num_sheets; ++$s) { $col_names[] = PMA_getColumnAlphaName($n + 1); } } - + $tables[] = array($sheet_names[$s], $col_names, $rows); - + $col_names = array(); $rows = array(); } diff --git a/libraries/import/xlsx.php b/libraries/import/xlsx.php index 54796230f8..2b5f628862 100644 --- a/libraries/import/xlsx.php +++ b/libraries/import/xlsx.php @@ -5,6 +5,7 @@ * * @todo Pretty much everything * @package phpMyAdmin-Import + * @subpackage XLSX */ if (! defined('PHPMYADMIN')) { @@ -54,26 +55,26 @@ $col_names = array(); for ($s = 0; $s < $num_sheets; ++$s) { $current_sheet = $objPHPExcel->getSheet($s); - + $num_rows = $current_sheet->getHighestRow(); $num_cols = PMA_getColumnNumberFromName($current_sheet->getHighestColumn()); - + if ($num_rows != 1 && $num_cols != 1) { for ($r = 1; $r <= $num_rows; ++$r) { for ($c = 0; $c < $num_cols; ++$c) { $cell = $current_sheet->getCellByColumnAndRow($c, $r)->getCalculatedValue(); - + if (! strcmp($cell, '')) { $cell = 'NULL'; } - + $tempRow[] = $cell; } - + $rows[] = $tempRow; $tempRow = array(); } - + if ($_REQUEST['xlsx_col_names']) { $col_names = array_splice($rows, 0, 1); $col_names = $col_names[0]; @@ -87,9 +88,9 @@ for ($s = 0; $s < $num_sheets; ++$s) { $col_names[] = PMA_getColumnAlphaName($n + 1); } } - + $tables[] = array($sheet_names[$s], $col_names, $rows); - + $col_names = array(); $rows = array(); } diff --git a/libraries/import/xml.php b/libraries/import/xml.php index d3d17b25c5..8fe45d80fe 100644 --- a/libraries/import/xml.php +++ b/libraries/import/xml.php @@ -4,8 +4,8 @@ * XML import plugin for phpMyAdmin * * @todo Improve efficiency - * @version 0.5-beta * @package phpMyAdmin-Import + * @subpackage XML */ if (! defined('PHPMYADMIN')) { @@ -141,19 +141,19 @@ if (isset($namespaces['pma'])) { * Get structures for all tables */ $struct = $xml->children($namespaces['pma']); - + $create = array(); - + foreach ($struct as $tier1 => $val1) { foreach($val1 as $tier2 => $val2) { /* Need to select the correct database for the creation of tables, views, triggers, etc. */ /** - * @todo Generating a USE here blocks importing of a table - * into another database. + * @todo Generating a USE here blocks importing of a table + * into another database. */ $attrs = $val2->attributes(); $create[] = "USE " . PMA_backquote($attrs["name"]); - + foreach ($val2 as $val3) { /** * Remove the extra cosmetic spacing @@ -163,7 +163,7 @@ if (isset($namespaces['pma'])) { } } } - + $struct_present = true; } @@ -179,13 +179,13 @@ $data_present = false; */ if (@count($xml->children())) { $data_present = true; - + /** * Process all database content */ foreach ($xml as $k1 => $v1) { $tbl_attr = $v1->attributes(); - + $isInTables = false; for ($i = 0; $i < count($tables); ++$i) { if (! strcmp($tables[$i][TBL_NAME], (string)$tbl_attr['name'])) { @@ -193,11 +193,11 @@ if (@count($xml->children())) { break; } } - + if ($isInTables == false) { $tables[] = array((string)$tbl_attr['name']); } - + foreach ($v1 as $k2 => $v2) { $row_attr = $v2->attributes(); if (! array_search((string)$row_attr['name'], $tempRow)) @@ -206,17 +206,17 @@ if (@count($xml->children())) { } $tempCells[] = (string)$v2; } - + $rows[] = array((string)$tbl_attr['name'], $tempRow, $tempCells); - + $tempRow = array(); $tempCells = array(); } - + unset($tempRow); unset($tempCells); unset($xml); - + /** * Bring accumulated rows into the corresponding table */ @@ -227,17 +227,17 @@ if (@count($xml->children())) { if (! isset($tables[$i][COL_NAMES])) { $tables[$i][] = $rows[$j][COL_NAMES]; } - + $tables[$i][ROWS][] = $rows[$j][ROWS]; } } } - + unset($rows); - + if (! $struct_present) { $analyses = array(); - + $len = count($tables); for ($i = 0; $i < $len; ++$i) { $analyses[] = PMA_analyzeTable($tables[$i]); @@ -289,7 +289,7 @@ if (strlen($db)) { if ($db_name === NULL) { $db_name = 'XML_DB'; } - + /* Set database collation/charset */ $options = array( 'db_collation' => $collation, From cb043f4365be9b8edec63188d339eda2154401fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 21 Jun 2011 12:04:52 +0200 Subject: [PATCH 7/8] Use standard infrastructure for generating links, this also prevents XSS --- enum_editor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enum_editor.php b/enum_editor.php index 586e85e7ff..ab86d737cb 100644 --- a/enum_editor.php +++ b/enum_editor.php @@ -53,11 +53,11 @@ require_once './libraries/header_meta_style.inc.php'; ?>

- "> +

- + From dc6c1e8b5cc0d2d116e000cba7752f60be248ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 21 Jun 2011 12:08:48 +0200 Subject: [PATCH 8/8] I think htmlspecialchars should be used here --- import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import.php b/import.php index 78e5ffdb4a..d706b60552 100644 --- a/import.php +++ b/import.php @@ -108,7 +108,7 @@ if ($import_type == 'table') { } $err_url = $goto . '?' . $common - . (preg_match('@^tbl_[a-z]*\.php$@', $goto) ? '&table=' . urlencode($table) : ''); + . (preg_match('@^tbl_[a-z]*\.php$@', $goto) ? '&table=' . htmlspecialchars($table) : ''); $_SESSION['Import_message']['go_back_url'] = $err_url; }