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'; ?>
- "> +
- + diff --git a/import.php b/import.php index cd56bc2c37..fea35c5aaf 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; } 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 41c3cf39d7..62b1537375 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -1,7 +1,10 @@ '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..af5af76546 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -1,9 +1,10 @@ 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 +85,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 +109,8 @@ function PMA_exportHeader() { * @access public */ function PMA_exportDBHeader($db) { - - + + return true; } @@ -155,33 +156,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 +197,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..487c2dfb59 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -1,9 +1,10 @@ 'bool', - 'name' => 'no_auto_value_on_zero', + 'type' => 'bool', + 'name' => 'no_auto_value_on_zero', 'text' => __('Do not useAUTO_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,
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 @@