diff options
author | Christian Foellmann <foellmann@foe-services.de> | 2015-04-21 11:51:19 +0300 |
---|---|---|
committer | Christian Foellmann <foellmann@foe-services.de> | 2015-04-21 11:51:19 +0300 |
commit | 329bb4a0bbe3a999388a6ed71d89d6f631d8b99e (patch) | |
tree | 3954db01d4b294d8449abdb4f676a0814ea810e4 | |
parent | 2e23de6bbd7ff4581620e6b630a9fec46aa86bdf (diff) |
UPDATE 4.4.34.4.3
25 files changed, 94 insertions, 68 deletions
@@ -1,6 +1,19 @@ phpMyAdmin - ChangeLog ====================== +4.4.3.0 (2015-04-20) +- bug #4851 PHP errors in login dialogue +- bug #4845 White screen (Cloudflare) +- bug #4207 json_encode error due to strftime returning non utf8 chars in Windows 8.1 Chinese version +- bug #4794 Server error viewing table content +- bug Fix issues related to number of decimal places in time +- bug #4853 Relation view between 1600 and 1780 px +- bug PHP 7 compatibility in php-gettext +- bug PHP 7 compatibility in bfShapeFiles +- bug PHP 7 session_regenerate_id() warning +- bug #4857 Alter table after changing column name error +- bug #4830 Maximum execution time exceeded in Util.class.php + 4.4.2.0 (2015-04-13) - bug #4835 PMA_hideShowConnection not called after submit_num_fields - bug #4836 Server warning after moving from console to direct clicks @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 4.4.2 +Version 4.4.3 A set of PHP-scripts to manage MySQL over the web. diff --git a/js/functions.js b/js/functions.js index 9e49f2cf9f..41381481eb 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1115,19 +1115,24 @@ function addDateTimePicker() { if ($.timepicker !== undefined) { $('input.timefield, input.datefield, input.datetimefield').each(function () { - no_decimals = $(this).parent().attr('data-decimals'); + var decimals = $(this).parent().attr('data-decimals'); + var type = $(this).parent().attr('data-type'); + var showMillisec = false; var showMicrosec = false; var timeFormat = 'HH:mm:ss'; // check for decimal places of seconds - if (($(this).parent().attr('data-decimals') > 0) && ($(this).parent().attr('data-type').indexOf('time') != -1)){ - showMillisec = true; - timeFormat = 'HH:mm:ss.lc'; - if ($(this).parent().attr('data-decimals') > 3) { + if (decimals > 0 && type.indexOf('time') != -1){ + if (decimals > 3) { + showMillisec = true; showMicrosec = true; + timeFormat = 'HH:mm:ss.lc'; + } else { + showMillisec = true; + timeFormat = 'HH:mm:ss.l'; } } - PMA_addDatepicker($(this), $(this).parent().attr('data-type'), { + PMA_addDatepicker($(this), type, { showMillisec: showMillisec, showMicrosec: showMicrosec, timeFormat: timeFormat diff --git a/js/line_counts.php b/js/line_counts.php index 32930d9b25..dc790d1579 100644 --- a/js/line_counts.php +++ b/js/line_counts.php @@ -14,7 +14,7 @@ define('LINE_COUNTS', true); $LINE_COUNT = array(); $LINE_COUNT["error_report.js"] = 338; -$LINE_COUNT["functions.js"] = 4539; +$LINE_COUNT["functions.js"] = 4544; $LINE_COUNT["db_central_columns.js"] = 197; $LINE_COUNT["jquery/jquery-ui-timepicker-addon.js"] = 2223; $LINE_COUNT["jquery/jquery.cookie.js"] = 91; @@ -167,7 +167,7 @@ $LINE_COUNT["rte.js"] = 944; $LINE_COUNT["server_status_processes.js"] = 189; $LINE_COUNT["tbl_relation.js"] = 233; $LINE_COUNT["server_status_queries.js"] = 34; -$LINE_COUNT["tbl_structure.js"] = 396; +$LINE_COUNT["tbl_structure.js"] = 393; $LINE_COUNT["jqplot/plugins/jqplot.categoryAxisRenderer.js"] = 679; $LINE_COUNT["jqplot/plugins/jqplot.pointLabels.js"] = 376; $LINE_COUNT["jqplot/plugins/jqplot.dateAxisRenderer.js"] = 741; diff --git a/js/makegrid.js b/js/makegrid.js index a7f06e5f72..48f311e79c 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -656,7 +656,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi new_html = new_html.replace(/\n/g, '<br>\n'); //remove decimal places if column type not supported - if (($this_field.attr('data-decimals') === 0) && ( $this_field.attr('data-type').indexOf('time') != -1)) { + if (($this_field.attr('data-decimals') == 0) && ( $this_field.attr('data-type').indexOf('time') != -1)) { new_html = new_html.substring(0, new_html.indexOf('.')); } diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 4cd0dc314e..9cd7cd58a7 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -92,9 +92,6 @@ AJAX.registerOnload('tbl_structure.js', function () { indexes = []; fulltext_indexes = []; - //by default select the last option to add new column (adds at end of the table) - $("select[name=after_field] option:last").attr("selected","selected"); - /** *Ajax action for submitting the "Column Change" and "Add Column" form */ diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 7a52f9ff4e..a675817f80 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -114,7 +114,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '4.4.2'); + $this->set('PMA_VERSION', '4.4.3'); /** * @deprecated */ diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 6f5f586c71..f336ac782d 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2420,7 +2420,8 @@ class PMA_DisplayResults private function _buildNullDisplay($class, $condition_field, $meta, $align = '') { // the null class is needed for grid editing - return '<td ' . $align . ' data-decimals="' . $meta->decimals + $decimals = isset($meta->decimals) ? $meta->decimals : '-1'; + return '<td ' . $align . ' data-decimals="' . $decimals . '" data-type="' . $meta->type . '" class="' . $this->_addClass( $class, $condition_field, $meta, '' @@ -2498,7 +2499,7 @@ class PMA_DisplayResults } $mime_map = $this->__get('mime_map'); - $orgFullColName = $meta->db . '.' . $meta->orgtable . '.' . $meta->orgname; + $orgFullColName = $this->__get('db') . '.' . $meta->orgtable . '.' . $meta->orgname; if ($transformation_plugin != $default_function || !empty($mime_map[$orgFullColName]['input_transformation']) ) { @@ -2697,7 +2698,9 @@ class PMA_DisplayResults } // end if (1) // 2. Displays the rows' values - $this->_setMimeMap(); + if (is_null($this->__get('mime_map'))) { + $this->_setMimeMap(); + } $table_body_html .= $this->_getRowValues( $dt_result, $row, $row_no, $col_order, $map, $grid_edit_class, $col_visib, $where_clause, @@ -2744,7 +2747,7 @@ class PMA_DisplayResults ++$currentColumn) { $meta = $fields_meta[$currentColumn]; - $orgFullTableName = $meta->db . '.' . $meta->orgtable; + $orgFullTableName = $this->__get('db') . '.' . $meta->orgtable; if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] @@ -2753,7 +2756,7 @@ class PMA_DisplayResults && empty($added[$orgFullTableName]) ) { $mimeMap = array_merge( - $mimeMap, PMA_getMIME($meta->db, $meta->orgtable, false, true) + $mimeMap, PMA_getMIME($this->__get('db'), $meta->orgtable, false, true) ); $added[$orgFullTableName] = true; } @@ -2845,7 +2848,7 @@ class PMA_DisplayResults $meta = $fields_meta[$i]; $orgFullColName - = $meta->db . '.' . $meta->orgtable . '.' . $meta->orgname; + = $this->__get('db') . '.' . $meta->orgtable . '.' . $meta->orgname; $not_null_class = $meta->not_null ? 'not_null' : ''; $relation_class = isset($map[$meta->name]) ? 'relation' : ''; @@ -2920,7 +2923,7 @@ class PMA_DisplayResults // Check whether the field needs to display with syntax highlighting - $dbLower = /*overload*/mb_strtolower($meta->db); + $dbLower = /*overload*/mb_strtolower($this->__get('db')); $tblLower = /*overload*/mb_strtolower($meta->orgtable); $nameLower = /*overload*/mb_strtolower($meta->orgname); if (! empty($this->transformation_info[$dbLower][$tblLower][$nameLower]) @@ -2990,7 +2993,7 @@ class PMA_DisplayResults ); $transform_url_params = array( - 'db' => $meta->db, + 'db' => $this->__get('db'), 'table' => $meta->orgtable, 'where_clause' => $unique_conditions[0], 'transform_key' => $meta->orgname @@ -5206,7 +5209,8 @@ class PMA_DisplayResults $relational_display = $_SESSION['tmpval']['relational_display']; $printview = $this->__get('printview'); - $result = '<td data-decimals="' . $meta->decimals . '" data-type="' + $decimals = isset($meta->decimals) ? $meta->decimals : '-1'; + $result = '<td data-decimals="' . $decimals . '" data-type="' . $meta->type . '" class="' . $this->_addClass( $class, $condition_field, $meta, $nowrap, diff --git a/libraries/Scripts.class.php b/libraries/Scripts.class.php index 6bd2c914c0..9feb02cbcb 100644 --- a/libraries/Scripts.class.php +++ b/libraries/Scripts.class.php @@ -57,10 +57,10 @@ class PMA_Scripts if (/*overload*/mb_strpos($value['filename'], "?") !== false) { if ($value['before_statics'] === true) { $first_dynamic_scripts - .= "<script type='text/javascript' src='js/" + .= "<script data-cfasync='false' type='text/javascript' src='js/" . $value['filename'] . "'></script>"; } else { - $dynamic_scripts .= "<script type='text/javascript' src='js/" + $dynamic_scripts .= "<script data-cfasync='false' type='text/javascript' src='js/" . $value['filename'] . "'></script>"; } continue; @@ -85,7 +85,7 @@ class PMA_Scripts $url = 'js/get_scripts.js.php?' . implode($separator, $scripts); $static_scripts = sprintf( - '<script type="text/javascript" src="%s"></script>', + '<script data-cfasync="false" type="text/javascript" src="%s"></script>', htmlspecialchars($url) ); return $first_dynamic_scripts . $static_scripts . $dynamic_scripts; @@ -266,7 +266,7 @@ class PMA_Scripts $code .= '});'; $this->addCode($code); - $retval .= '<script type="text/javascript">'; + $retval .= '<script data-cfasync="false" type="text/javascript">'; $retval .= "// <![CDATA[\n"; $retval .= $this->_code; foreach ($this->_events as $js_event) { diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 32f9150ba8..3964d68ec3 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1610,7 +1610,14 @@ class PMA_Util $date ); - return strftime($date, $timestamp); + $ret = strftime($date, $timestamp); + // Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8 + // output here. See https://sourceforge.net/p/phpmyadmin/bugs/4207/ + if (mb_detect_encoding($ret, 'UTF-8', true) != 'UTF-8') { + $ret = date('Y-m-d H:i:s', $timestamp); + } + + return $ret; } // end of the 'localisedDate()' function /** diff --git a/libraries/bfShapeFiles/ShapeFile.lib.php b/libraries/bfShapeFiles/ShapeFile.lib.php index bf726a328c..795d0aa292 100644 --- a/libraries/bfShapeFiles/ShapeFile.lib.php +++ b/libraries/bfShapeFiles/ShapeFile.lib.php @@ -83,7 +83,7 @@ var $records; - function ShapeFile($shapeType, $boundingBox = array("xmin" => 0.0, "ymin" => 0.0, "xmax" => 0.0, "ymax" => 0.0), $FileName = NULL) { + public function __construct($shapeType, $boundingBox = array("xmin" => 0.0, "ymin" => 0.0, "xmax" => 0.0, "ymax" => 0.0), $FileName = NULL) { $this->shapeType = $shapeType; $this->boundingBox = $boundingBox; $this->FileName = $FileName; @@ -357,7 +357,7 @@ var $SHPData = array(); var $DBFData = array(); - function ShapeRecord($shapeType) { + public function __construct($shapeType) { $this->shapeType = $shapeType; } diff --git a/libraries/common.inc.php b/libraries/common.inc.php index ac243980fd..a4d15e265a 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -1177,6 +1177,7 @@ if (!empty($__redirect) && in_array($__redirect, $goto_whitelist)) { // If Zero configuration mode enabled, check PMA tables in current db. if (! defined('PMA_MINIMUM_COMMON') + && ! empty($GLOBALS['server']) && isset($GLOBALS['cfg']['ZeroConf']) && $GLOBALS['cfg']['ZeroConf'] == true ) { diff --git a/libraries/dbi/DBIMysql.class.php b/libraries/dbi/DBIMysql.class.php index 36e81e6404..43973b28af 100644 --- a/libraries/dbi/DBIMysql.class.php +++ b/libraries/dbi/DBIMysql.class.php @@ -10,6 +10,13 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! extension_loaded('mysql')) { + // The old MySQL extension is deprecated as of PHP 5.5.0, and will be + // removed in the future. Instead, the `MySQLi` or `PDO_MySQL` extension + // should be used. + return; +} + require_once './libraries/dbi/DBIExtension.int.php'; /** diff --git a/libraries/language_stats.inc.php b/libraries/language_stats.inc.php index 9329e3562d..01900107b1 100644 --- a/libraries/language_stats.inc.php +++ b/libraries/language_stats.inc.php @@ -12,7 +12,7 @@ $GLOBALS["language_stats"] = array ( 'bn' => 83, 'br' => 19, 'bs' => 14, - 'ca' => 99, + 'ca' => 100, 'ckb' => 17, 'cs' => 96, 'cy' => 19, @@ -36,7 +36,7 @@ $GLOBALS["language_stats"] = array ( 'hy' => 3, 'ia' => 68, 'id' => 73, - 'it' => 98, + 'it' => 100, 'ja' => 73, 'ka' => 15, 'kk' => 10, diff --git a/libraries/php-gettext/gettext.php b/libraries/php-gettext/gettext.php index 5064047cbd..3486e92f07 100644 --- a/libraries/php-gettext/gettext.php +++ b/libraries/php-gettext/gettext.php @@ -98,7 +98,7 @@ class gettext_reader { * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ - function gettext_reader($Reader, $enable_cache = true) { + public function __construct($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; diff --git a/libraries/php-gettext/streams.php b/libraries/php-gettext/streams.php index 3cdc1584e1..ab947194a2 100644 --- a/libraries/php-gettext/streams.php +++ b/libraries/php-gettext/streams.php @@ -49,7 +49,7 @@ class StringReader { var $_pos; var $_str; - function StringReader($str='') { + public function __construct($str='') { $this->_str = $str; $this->_pos = 0; } @@ -86,7 +86,7 @@ class FileReader { var $_fd; var $_length; - function FileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); @@ -143,7 +143,7 @@ class FileReader { // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { - function CachedFileReader($filename) { + public function __construct($filename) { if (file_exists($filename)) { $length=filesize($filename); diff --git a/libraries/session.inc.php b/libraries/session.inc.php index a0b58a532f..22185acb5e 100644 --- a/libraries/session.inc.php +++ b/libraries/session.inc.php @@ -119,7 +119,12 @@ if (! isset($_SESSION[' PMA_token '])) { function PMA_secureSession() { // prevent session fixation and XSS - session_regenerate_id(true); + // (better to use session_status() if available) + if ((PMA_PHP_INT_VERSION >= 50400 && session_status() === PHP_SESSION_ACTIVE) + || (PMA_PHP_INT_VERSION < 50400 && session_id() !== '') + ) { + session_regenerate_id(true); + } $_SESSION[' PMA_token '] = md5(uniqid(rand(), true)); } ?> diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 51dd2a5304..ab23b27d60 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1704,10 +1704,21 @@ function PMA_getHtmlForAddColumn($columns_list) . 'value="first" data-pos = "first">' . __('at beginning of table') . '</option>'; + $cols_count = count($columns_list); foreach ($columns_list as $one_column_name) { - $column_selector .= '<option ' - . 'value="' . htmlspecialchars($one_column_name) . '">' - . sprintf(__('after %s'), htmlspecialchars($one_column_name)) + //by default select the last column (add column at the end of the table) + if (--$cols_count == 0) { + $column_selector .= '<option ' + . 'value="' . htmlspecialchars($one_column_name) + . '" selected="selected">'; + } else { + $column_selector .= '<option ' + . 'value="' . htmlspecialchars($one_column_name) . '">'; + } + $column_selector .= sprintf( + __('after %s'), + htmlspecialchars($one_column_name) + ) . '</option>'; } $column_selector .= '</select>'; diff --git a/libraries/tbl_relation.lib.php b/libraries/tbl_relation.lib.php index 44faf5c94e..400ddf2e4e 100644 --- a/libraries/tbl_relation.lib.php +++ b/libraries/tbl_relation.lib.php @@ -463,7 +463,8 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i, . ' placeholder="' . __('Constraint name') . '" />'; $html_output .= '</span>' . "\n"; - $html_output .= '<span class="formelement clearfloat">'; + $html_output .= '<div class="floatleft">'; + $html_output .= '<span class="formelement">'; // For ON DELETE and ON UPDATE, the default action // is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE // won't display the clause if it's set as RESTRICT. @@ -477,7 +478,7 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i, ); $html_output .= '</span>' . "\n"; - $html_output .= '<span class="formelement clearfloat">' . "\n"; + $html_output .= '<span class="formelement">' . "\n"; $on_update = isset($one_key['on_update']) ? $one_key['on_update'] : 'RESTRICT'; $html_output .= PMA_generateDropdown( @@ -487,6 +488,7 @@ function PMA_getHtmlForForeignKeyRow($one_key, $odd_row, $columns, $i, $on_update ); $html_output .= '</span>'; + $html_output .= '</div>'; $column_array = array(); $column_array[''] = ''; diff --git a/locale/ca/LC_MESSAGES/phpmyadmin.mo b/locale/ca/LC_MESSAGES/phpmyadmin.mo Binary files differindex 751633964f..bba34c469c 100644 --- a/locale/ca/LC_MESSAGES/phpmyadmin.mo +++ b/locale/ca/LC_MESSAGES/phpmyadmin.mo diff --git a/locale/cs/LC_MESSAGES/phpmyadmin.mo b/locale/cs/LC_MESSAGES/phpmyadmin.mo Binary files differindex b5e18add3c..1294a4cf07 100644 --- a/locale/cs/LC_MESSAGES/phpmyadmin.mo +++ b/locale/cs/LC_MESSAGES/phpmyadmin.mo diff --git a/locale/fr/LC_MESSAGES/phpmyadmin.mo b/locale/fr/LC_MESSAGES/phpmyadmin.mo Binary files differindex 46f41e8a84..b34e7511fb 100644 --- a/locale/fr/LC_MESSAGES/phpmyadmin.mo +++ b/locale/fr/LC_MESSAGES/phpmyadmin.mo diff --git a/locale/it/LC_MESSAGES/phpmyadmin.mo b/locale/it/LC_MESSAGES/phpmyadmin.mo Binary files differindex 62f3cb103b..70351da356 100644 --- a/locale/it/LC_MESSAGES/phpmyadmin.mo +++ b/locale/it/LC_MESSAGES/phpmyadmin.mo diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php index a1bb85ff93..8bf7a6cb4d 100644 --- a/themes/original/css/common.css.php +++ b/themes/original/css/common.css.php @@ -247,19 +247,6 @@ fieldset .formelement { white-space: nowrap; } -@media all and (min-width: 1600px) { - fieldset .formelement { - clear: none; - } - #foreign_keys.relationalTable td:first-child + td select { - width: auto; - margin-right: 1%; - } - #foreign_keys.relationalTable { - width: 100%; - } -} - /* revert for Gecko */ fieldset div[class=formelement] { white-space: normal; diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 37b9aa9931..2c8e915148 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -531,19 +531,6 @@ fieldset .formelement { white-space: nowrap; } -@media all and (min-width: 1600px) { - fieldset .formelement { - clear: none; - } - #foreign_keys.relationalTable td:first-child + td select { - width: auto; - margin-right: 1%; - } - #foreign_keys.relationalTable { - width: 100%; - } -} - /* revert for Gecko */ fieldset div[class=formelement] { white-space: normal; |