Skip to content

Commit

Permalink
Merge branch '4.0' into 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Dec 11, 2024
2 parents 37070d4 + 8612be6 commit a587c82
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion phpmyfaq/assets/scss/layout/_autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
top: 5px;
right: 5px;
height: 50px;
width: 110px;
}
}

Expand Down
9 changes: 7 additions & 2 deletions phpmyfaq/assets/src/configuration/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export const handleUpdateInformation = async () => {
button.disabled = false;
} catch (errorMessage) {
if (errorMessage instanceof SyntaxError) {
errorMessage = 'The requested resource was not found on the server. Please check your server configuration.';
errorMessage =
'The requested resource was not found on the server. ' +
'Please check your server configuration, especially the RewriteBase in your .htaccess configuration.';
} else {
errorMessage = errorMessage.message;
}
Expand Down Expand Up @@ -142,10 +144,13 @@ export const handleDatabaseUpdate = async () => {

await pump();
}

await pump();
} catch (error) {
const errorMessage =
error.cause && error.cause.response ? await error.cause.response.json() : { error: 'Unknown error' };
error.cause && error.cause.response
? await error.cause.response.json()
: { error: 'Unknown database error during update.' };
const alert = document.getElementById('phpmyfaq-update-database-error');

alert.classList.remove('d-none');
Expand Down
9 changes: 9 additions & 0 deletions phpmyfaq/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,13 @@
'last_modified' => new DateTime()
]);

//
// Avoid automatic downloads
// and prevent browsers from interpreting files as a different MIME type than what is specified
//
if ($action !== 'attachment') {
$response->headers->set('Content-Disposition', 'inline');
}
$response->headers->set('X-Content-Type-Options', 'nosniff');

$response->send();
4 changes: 3 additions & 1 deletion phpmyfaq/src/phpMyFAQ/Setup/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,9 @@ public function checkBasicStuff(): void
}

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

Expand Down

0 comments on commit a587c82

Please sign in to comment.