Skip to content

Commit c937ef2

Browse files
committed
fix: corrected update routes, closes #3834
1 parent e0922a2 commit c937ef2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

docs/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ your-domain.com {
653653
654654
# Rewrite rules for phpMyFAQ
655655
rewrite /setup /setup/index.php
656-
rewrite /update /update/index.php
657656
rewrite /admin /admin/index.php
658657
rewrite /api/* /api/index.php
659658

phpmyfaq/assets/src/configuration/update.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const handleUpdateNextStepButton = (): void => {
3030
};
3131

3232
export const handleUpdateInformation = async (): Promise<void> => {
33-
if (window.location.href.endsWith('/update/') || window.location.href.endsWith('/update/index.php')) {
33+
if (window.location.href.endsWith('/update') || window.location.href.endsWith('/update/')) {
3434
const installedVersion = document.getElementById('phpmyfaq-update-installed-version') as HTMLInputElement | null;
3535

3636
if (!installedVersion) return;
@@ -87,7 +87,7 @@ export const handleUpdateInformation = async (): Promise<void> => {
8787
};
8888

8989
export const handleConfigBackup = async (): Promise<void> => {
90-
if (window.location.href.endsWith('/update/?step=2') || window.location.href.endsWith('/update/index.php?step=2')) {
90+
if (window.location.href.endsWith('/update/?step=2') || window.location.href.endsWith('/update/?step=2')) {
9191
const installedVersion = document.getElementById('phpmyfaq-update-installed-version') as HTMLInputElement | null;
9292

9393
if (!installedVersion) return;
@@ -115,7 +115,7 @@ export const handleConfigBackup = async (): Promise<void> => {
115115
};
116116

117117
export const handleDatabaseUpdate = async (): Promise<void> => {
118-
if (window.location.href.endsWith('/update/?step=3') || window.location.href.endsWith('/update/index.php?step=3')) {
118+
if (window.location.href.endsWith('/update/?step=3') || window.location.href.endsWith('/update/?step=3')) {
119119
const installedVersion = document.getElementById('phpmyfaq-update-installed-version') as HTMLInputElement | null;
120120

121121
if (!installedVersion) return;

phpmyfaq/src/public-routes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@
230230
'methods' => 'GET',
231231
],
232232
'public.update.index' => [
233-
'path' => '/update/',
233+
'path' => '/update',
234234
'controller' => [SetupController::class, 'update'],
235-
'methods' => 'POST',
235+
'methods' => 'GET',
236236
],
237237
];
238238

0 commit comments

Comments
 (0)