Skip to content

Commit 1cde51c

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents 962ff02 + 5a79ac7 commit 1cde51c

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

js/src/modules/ajax.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,12 +933,16 @@ const AJAX = {
933933
* @return {function(JQuery.Event, JQuery.jqXHR): void}
934934
*/
935935
getFatalErrorHandler: function () {
936-
return function (event, request) {
936+
return function (event, request, settings) {
937937
if (AJAX.debug) {
938938
// eslint-disable-next-line no-console
939939
console.log('AJAX error: status=' + request.status + ', text=' + request.statusText);
940940
}
941941

942+
if (settings.url.includes('/git-revision')) {
943+
return;
944+
}
945+
942946
// Don't handle aborted requests
943947
if (request.status !== 0 || request.statusText !== 'abort') {
944948
var details = '';

js/src/modules/git-info.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ const GitInfo = {
125125
'server': CommonParams.get('server'),
126126
'ajax_request': true,
127127
'no_debug': true
128-
},
129-
data => {
130-
if (typeof data !== 'undefined' && data.success === true) {
131-
$(data.message).insertAfter('#li_pma_version');
132-
}
133128
}
134-
);
129+
).done(function (data): void {
130+
if (typeof data !== 'undefined' && data.success === true) {
131+
$(data.message).insertAfter('#li_pma_version');
132+
}
133+
}).fail(function (): void {
134+
const gitHashInfoLi = '<li id="li_pma_version_git" class="list-group-item">' + window.Messages.errorLoadingGitInformation + '</li>';
135+
$(gitHashInfoLi).insertAfter('#li_pma_version');
136+
});
135137
},
136138

137139
/**

src/Controllers/JavaScriptMessagesController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ private function getMessages(): array
615615
/* l10n: Latest available phpMyAdmin version */
616616
'strLatestAvailable' => __(', latest stable version:'),
617617
'strUpToDate' => __('up to date'),
618+
'errorLoadingGitInformation' => __('There was an error in loading the Git information.'),
618619

619620
/* Error Reporting */
620621
'strErrorOccurred' => __('A fatal JavaScript error has occurred. Would you like to send an error report?'),

src/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use function fgets;
1818
use function fwrite;
1919
use function htmlspecialchars;
20-
use function is_resource;
2120
use function proc_close;
2221
use function proc_open;
2322
use function sprintf;
@@ -132,7 +131,7 @@ public function applyTransformation(string $buffer, array $options = [], FieldMe
132131
$newstring = '';
133132
$descriptorspec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w']];
134133
$process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes);
135-
if (is_resource($process)) {
134+
if ($process !== false) {
136135
fwrite($pipes[0], $buffer);
137136
fclose($pipes[0]);
138137

0 commit comments

Comments
 (0)