Skip to content

Commit a587c82

Browse files
committed
Merge branch '4.0' into 'main'
2 parents 37070d4 + 8612be6 commit a587c82

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

phpmyfaq/assets/scss/layout/_autocomplete.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
top: 5px;
2525
right: 5px;
2626
height: 50px;
27-
width: 110px;
2827
}
2928
}
3029

phpmyfaq/assets/src/configuration/update.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export const handleUpdateInformation = async () => {
5353
button.disabled = false;
5454
} catch (errorMessage) {
5555
if (errorMessage instanceof SyntaxError) {
56-
errorMessage = 'The requested resource was not found on the server. Please check your server configuration.';
56+
errorMessage =
57+
'The requested resource was not found on the server. ' +
58+
'Please check your server configuration, especially the RewriteBase in your .htaccess configuration.';
5759
} else {
5860
errorMessage = errorMessage.message;
5961
}
@@ -142,10 +144,13 @@ export const handleDatabaseUpdate = async () => {
142144

143145
await pump();
144146
}
147+
145148
await pump();
146149
} catch (error) {
147150
const errorMessage =
148-
error.cause && error.cause.response ? await error.cause.response.json() : { error: 'Unknown error' };
151+
error.cause && error.cause.response
152+
? await error.cause.response.json()
153+
: { error: 'Unknown database error during update.' };
149154
const alert = document.getElementById('phpmyfaq-update-database-error');
150155

151156
alert.classList.remove('d-none');

phpmyfaq/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,4 +681,13 @@
681681
'last_modified' => new DateTime()
682682
]);
683683

684+
//
685+
// Avoid automatic downloads
686+
// and prevent browsers from interpreting files as a different MIME type than what is specified
687+
//
688+
if ($action !== 'attachment') {
689+
$response->headers->set('Content-Disposition', 'inline');
690+
}
691+
$response->headers->set('X-Content-Type-Options', 'nosniff');
692+
684693
$response->send();

phpmyfaq/src/phpMyFAQ/Setup/Installer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ public function checkBasicStuff(): void
640640
}
641641

642642
if (!$this->system->checkInstallation()) {
643-
throw new Exception('phpMyFAQ is already installed! Please use the <a href="../update">update</a>.');
643+
throw new Exception(
644+
'Looks like phpMyFAQ is already installed! Please use the <a href="../update">update</a>.'
645+
);
644646
}
645647
}
646648

0 commit comments

Comments
 (0)