Skip to content

Commit b5899c2

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents 3c02b3c + f17ba4b commit b5899c2

7 files changed

Lines changed: 33 additions & 24 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ phpMyAdmin - ChangeLog
3737
- issue Stop pmadb database detection when all features are disabled
3838
- issue Replace slim/psr7 by nyholm/psr7 (CVE-2023-30536)
3939
- issue #17654 Fix unprivileged user cannot change password on MySQL >= 5.7.37
40+
- issue Add CVE MITRE link to allowed domains and use cve.org
41+
- issue #18330 Fix TypeError when no-datetime field is modified
42+
- issue #18212 Fix Query Builder doesn't replace a table name with it's alias in the `WHERE` block
4043

4144
5.2.1 (2023-02-07)
4245
- issue #17522 Fix case where the routes cache file is invalid

js/src/database/query_generator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ function getFormatsText () {
3131
}
3232

3333
function generateCondition (criteriaDiv, table) {
34-
var query = '`' + escapeBacktick(table.val()) + '`.';
34+
const tableName = table.val();
35+
const tableAlias = table.siblings('.table_alias').val();
36+
37+
var query = '`' + escapeBacktick(tableAlias === '' ? tableName : tableAlias) + '`.';
3538
query += '`' + escapeBacktick(table.siblings('.columnNameSelect').first().val()) + '`';
3639
if (criteriaDiv.find('.criteria_rhs').first().val() === 'text') {
3740
var formatsText = getFormatsText();

js/src/modules/functions.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,25 +3647,28 @@ function onloadLoginForm () {
36473647
* @param $inputField
36483648
*/
36493649
function toggleDatepickerIfInvalid ($td, $inputField) {
3650-
// Regex allowed by the Datetimepicker UI
3651-
var dtexpDate = new RegExp([
3652-
'^([0-9]{4})',
3653-
'-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',
3654-
'-((0[1-9])|([1-2][0-9])|30)))$'
3655-
].join(''));
3656-
var dtexpTime = new RegExp([
3657-
'^(([0-1][0-9])|(2[0-3]))',
3658-
':((0[0-9])|([1-5][0-9]))',
3659-
':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'
3660-
].join(''));
3661-
3662-
// If key-ed in Time or Date values are unsupported by the UI, close it
3663-
if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {
3664-
$inputField.datepicker('hide');
3665-
} else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {
3666-
$inputField.datepicker('hide');
3667-
} else {
3668-
$inputField.datepicker('show');
3650+
// If the Datetimepicker UI is not present, return
3651+
if ($inputField.hasClass('hasDatepicker')) {
3652+
// Regex allowed by the Datetimepicker UI
3653+
var dtexpDate = new RegExp([
3654+
'^([0-9]{4})',
3655+
'-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',
3656+
'-((0[1-9])|([1-2][0-9])|30)))$'
3657+
].join(''));
3658+
var dtexpTime = new RegExp([
3659+
'^(([0-1][0-9])|(2[0-3]))',
3660+
':((0[0-9])|([1-5][0-9]))',
3661+
':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'
3662+
].join(''));
3663+
3664+
// If key-ed in Time or Date values are unsupported by the UI, close it
3665+
if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {
3666+
$inputField.datepicker('hide');
3667+
} else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {
3668+
$inputField.datepicker('hide');
3669+
} else {
3670+
$inputField.datepicker('show');
3671+
}
36693672
}
36703673
}
36713674

libraries/classes/Controllers/ChangeLogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __invoke(ServerRequest $request): void
8181

8282
// CVE/CAN entries
8383
'/((CAN|CVE)-[0-9]+-[0-9]+)/' => '<a href="' . Url::getFromRoute('/url') . '&url='
84-
. 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
84+
. 'https://www.cve.org/CVERecord?id=\\1">\\1</a>',
8585

8686
// PMASAentries
8787
'/(PMASA-[0-9]+-[0-9]+)/' => '<a href="'

libraries/classes/Core.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ public static function isAllowedDomain(string $url): bool
559559
'www.github.com',
560560
/* Percona domains */
561561
'www.percona.com',
562+
/* CVE domain */
563+
'www.cve.org',
562564
/* Following are doubtful ones. */
563565
'mysqldatabaseadministration.blogspot.com',
564566
];

public/themes/pmahomme/scss/_tables.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
th {
1111
color: $th-color;
12-
text-align: left;
1312
}
1413

1514
td {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<a href="{{ url('/table/structure', table_url_params) }}#showusage" id="overhead">
2-
<span>{{ formatted_overhead }}</span>&nbsp;
3-
<span class="unit">{{ overhead_unit }}</span>
2+
<span>{{ formatted_overhead }}</span>&nbsp;<span class="unit">{{ overhead_unit }}</span>
43
</a>

0 commit comments

Comments
 (0)