Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit daae304

Browse files
committed
Merge branch 'master' into master-security
2 parents cad75c9 + 3313dc2 commit daae304

105 files changed

Lines changed: 20983 additions & 20505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ phpMyAdmin - ChangeLog
3131
- issue #12302 Improved usage of number_format
3232
- issue #12656 Server selection not working
3333
- issue #12543 NULL results in dataset are colored grey
34+
- issue #12664 Create Bookmark broken
3435

3536
4.6.5 (not yet released)
3637
- issue Remove potentionally license problematic sRGB profile
@@ -106,6 +107,13 @@ phpMyAdmin - ChangeLog
106107
- issue #12637 Fixed editing some timestamp values
107108
- issue #12622 Fixed javascript error in designer
108109
- issue #12334 Missing page indicator or VIEWs
110+
- issue #12610 Export of tables with Timestamp/Datetime/Time columns defined with ON UPDATE clause with precision fails
111+
- issue #12661 Error inserting into pma__history after timeout
112+
- issue #12195 Row_format = fixed not visible
113+
- issue #12665 Cannot add a foreign key - non-indexed fields not listed in InnoDB tables
114+
- issue #12674 Allow for proper MySQL-allowed strings as identifiers
115+
- issue #12651 Allow for partial dates on table insert page
116+
- issue #12681 Fixed designer with tables using special chars
109117

110118
4.6.4 (2016-08-16)
111119
- issue [security] Weaknesses with cookie encryption, see PMASA-2016-29

doc/faq.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,9 @@ re–written, if possible it is suggested that you upgrade to take
14651465
advantage of the new features. For additional help on this subject,
14661466
look for the word "upload" in this document.
14671467

1468+
Note: For errors while importing of dumps exported from older MySQL versions to newer MySQL versions,
1469+
please check :ref:`faq6_41`.
1470+
14681471
.. _faq6_6:
14691472

14701473
6.6 How can I use the relation table in Query-by-example?
@@ -2130,6 +2133,31 @@ Parameters should be prefixed with a colon(:) and when the "Bind parameters" che
21302133
these parameters will be identified and input fields for these parameters will be presented.
21312134
Values entered in these field will be substituted in the query before being executed.
21322135

2136+
.. _faq6_41:
2137+
2138+
6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ?
2139+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2140+
2141+
If you get errors like *#1031 - Table storage engine for 'table_name' doesn't have this option*
2142+
while importing the dumps exported from pre-5.7.7 MySQL servers into new MySQL server versions 5.7.7+,
2143+
it might be because ROW_FORMAT=FIXED is not supported with InnoDB tables. Moreover, the value of
2144+
`innodb_strict_mode <http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_strict_mode>`_ would define if this would be reported as a warning or as an error.
2145+
2146+
Since MySQL version 5.7.9, the default value for `innodb_strict_mode` is `ON` and thus would generate
2147+
an error when such a CREATE TABLE or ALTER TABLE statement is encountered.
2148+
2149+
There are two ways of preventing such errors while importing:
2150+
2151+
* Change the value of `innodb_strict_mode` to `OFF` before starting the import and turn it `ON` after
2152+
the import is successfully completed.
2153+
* This can be achieved in two ways:
2154+
2155+
* Go to 'Variables' page and edit the value of `innodb_strict_mode`
2156+
* Run the query : `SET GLOBAL `innodb_strict_mode` = '[value]'`
2157+
2158+
After the import is done, it is suggested that the value of `innodb_strict_mode` should be reset to the
2159+
original value.
2160+
21332161
.. _faqproject:
21342162

21352163
phpMyAdmin project

import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@
738738
// since only one bookmark has to be added for all the queries submitted through
739739
// the SQL tab
740740
if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
741-
$cfgBookmark = PMA_Bookmark_getParams();
741+
$cfgBookmark = Bookmark::getParams();
742742
PMA_storeTheQueryAsBookmark(
743743
$db, $cfgBookmark['user'],
744744
$_REQUEST['sql_query'], $_POST['bkm_label'],

index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PMA\libraries\Sanitize;
1111
use PMA\libraries\Charsets;
1212
use PMA\libraries\ThemeManager;
13+
use PMA\libraries\LanguageManager;
1314

1415
/**
1516
* Gets some core libraries and displays a top message if required
@@ -236,9 +237,9 @@
236237
// Displays language selection combo
237238
if (empty($cfg['Lang'])) {
238239
echo '<li id="li_select_lang" class="no_bullets">';
239-
include_once 'libraries/display_select_lang.lib.php';
240+
240241
echo PMA\libraries\Util::getImage('s_lang.png') , " "
241-
, PMA_getLanguageSelectorHtml();
242+
, LanguageManager::getInstance()->getSelectorDisplay();
242243
echo '</li>';
243244
}
244245

js/functions.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ function addDateTimePicker() {
188188
timeFormat: timeFormat
189189
});
190190

191-
// Add a tip regarding entering MySQL allowed-values for TIME data-type
191+
// Add a tip regarding entering MySQL allowed-values
192+
// for TIME and DATE data-type
192193
if ($(this).hasClass('timefield')) {
193-
PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTip);
194+
PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipTime);
195+
} else if ($(this).hasClass('datefield')) {
196+
PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipDate);
194197
}
195198
});
196199
}
@@ -4961,6 +4964,30 @@ function PMA_ignorePhpErrors(clearPrevErrors){
49614964
$pmaErrors.remove();
49624965
}
49634966

4967+
/**
4968+
* Toggle the Datetimepicker UI if the date value entered
4969+
* by the user in the 'text box' is not going to be accepted
4970+
* by the Datetimepicker plugin (but is accepted by MySQL)
4971+
*/
4972+
function toggleDatepickerIfInvalid($td, $input_field) {
4973+
// Regex allowed by the Datetimepicker UI
4974+
var dtexpDate = new RegExp(['^([0-9]{4})',
4975+
'-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',
4976+
'-((0[1-9])|([1-2][0-9])|30)))$'].join(''));
4977+
var dtexpTime = new RegExp(['^(([0-1][0-9])|(2[0-3]))',
4978+
':((0[0-9])|([1-5][0-9]))',
4979+
':((0[0-9])|([1-5][0-9]))(\.[0-9]{1,6}){0,1}$'].join(''));
4980+
4981+
// If key-ed in Time or Date values are unsupported by the UI, close it
4982+
if ($td.attr('data-type') === 'date' && ! dtexpDate.test($input_field.val())) {
4983+
$input_field.datepicker('hide');
4984+
} else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($input_field.val())) {
4985+
$input_field.datepicker('hide');
4986+
} else {
4987+
$input_field.datepicker('show');
4988+
}
4989+
}
4990+
49644991
/**
49654992
* Unbind all event handlers before tearing down a page
49664993
*/

js/makegrid.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,21 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
10511051
timeFormat: timeFormat
10521052
});
10531053

1054+
$input_field.on('keyup', function (e) {
1055+
if (e.which == 13) {
1056+
// post on pressing "Enter"
1057+
e.preventDefault();
1058+
e.stopPropagation();
1059+
g.saveOrPostEditedCell();
1060+
} else if (e.which == 27) {
1061+
} else {
1062+
toggleDatepickerIfInvalid($td, $input_field);
1063+
}
1064+
});
1065+
10541066
$input_field.datepicker("show");
1067+
toggleDatepickerIfInvalid($td, $input_field);
1068+
10551069
// unbind the mousedown event to prevent the problem of
10561070
// datepicker getting closed, needs to be checked for any
10571071
// change in names when updating

js/messages.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,17 @@ function () {
523523
$js_messages['strEncryptionKey'] = __('Encryption key');
524524

525525
/* For Tip to be shown on Time field */
526-
$js_messages['strMysqlAllowedValuesTip'] = __(
526+
$js_messages['strMysqlAllowedValuesTipTime'] = __(
527527
'MySQL accepts additional values not selectable by the slider;'
528528
. ' key in those values directly if desired'
529529
);
530530

531+
/* For Tip to be shown on Date field */
532+
$js_messages['strMysqlAllowedValuesTipDate'] = __(
533+
'MySQL accepts additional values not selectable by the datepicker;'
534+
. ' key in those values directly if desired'
535+
);
536+
531537
/* For Lock symbol Tooltip */
532538
$js_messages['strLockToolTip'] = __(
533539
'Indicates that you have made changes to this page;'

js/tbl_change.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function isDate(val, tmstmp)
100100
}
101101
val = arrayVal.join("-");
102102
var pos = 2;
103-
var dtexp = new RegExp(/^([0-9]{4})-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[1-9])|([1-2][0-9])|30)))$/);
103+
var dtexp = new RegExp(/^([0-9]{4})-(((01|03|05|07|08|10|12)-((0[0-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[0-9])|([1-2][0-9])|30))|((00)-(00)))$/);
104104
if (val.length == 8) {
105105
pos = 0;
106106
}

libraries/Footer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ private function _setHistory()
237237
if (! PMA_isValid($_REQUEST['no_history'])
238238
&& empty($GLOBALS['error_message'])
239239
&& ! empty($GLOBALS['sql_query'])
240+
&& (isset($GLOBALS['dbi'])
241+
&& ($GLOBALS['dbi']->getLink()
242+
|| isset($GLOBALS['controllink'])
243+
&& $GLOBALS['controllink']))
240244
) {
241245
PMA_setHistory(
242246
PMA_ifSetOr($GLOBALS['db'], ''),

libraries/LanguageManager.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace PMA\libraries;
99

1010
use PMA\libraries\Language;
11+
use PMA\libraries\URL;
1112

1213
/**
1314
* Language selection manager
@@ -890,4 +891,43 @@ public function showWarnings()
890891
);
891892
}
892893
}
894+
895+
896+
/**
897+
* Returns HTML code for the language selector
898+
*
899+
* @param boolean $use_fieldset whether to use fieldset for selection
900+
* @param boolean $show_doc whether to show documentation links
901+
*
902+
* @return string
903+
*
904+
* @access public
905+
*/
906+
public function getSelectorDisplay($use_fieldset = false, $show_doc = true)
907+
{
908+
$_form_params = array(
909+
'db' => $GLOBALS['db'],
910+
'table' => $GLOBALS['table'],
911+
);
912+
913+
// For non-English, display "Language" with emphasis because it's
914+
// not a proper word in the current language; we show it to help
915+
// people recognize the dialog
916+
$language_title = __('Language')
917+
. (__('Language') != 'Language' ? ' - <em>Language</em>' : '');
918+
if ($show_doc) {
919+
$language_title .= Util::showDocu('faq', 'faq7-2');
920+
}
921+
922+
$available_languages = $this->sortedLanguages();
923+
924+
return Template::get('select_lang')->render(
925+
array(
926+
'language_title' => $language_title,
927+
'use_fieldset' => $use_fieldset,
928+
'available_languages' => $available_languages,
929+
'_form_params' => $_form_params,
930+
)
931+
);
932+
}
893933
}

0 commit comments

Comments
 (0)