X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fupdater%2FUpdater.php;h=4bbcb9f270664a8e11266716548f502368765aec;hb=485b168a9677d160b0c0426e4f282b9bd0c632c1;hp=95654d81da96c0d23c2d26424c47983b39c25961;hpb=bee33239ed444f9724422fe5234cd79997500519;p=github%2Fshaarli%2FShaarli.git diff --git a/application/updater/Updater.php b/application/updater/Updater.php index 95654d81..4bbcb9f2 100644 --- a/application/updater/Updater.php +++ b/application/updater/Updater.php @@ -2,8 +2,8 @@ namespace Shaarli\Updater; -use Shaarli\Config\ConfigManager; use Shaarli\Bookmark\BookmarkServiceInterface; +use Shaarli\Config\ConfigManager; use Shaarli\Updater\Exception\UpdaterException; /** @@ -111,4 +111,20 @@ class Updater { return $this->doneUpdates; } + + /** + * With the Slim routing system, default header link should be `./` instead of `?`. + * Otherwise you can not go back to the home page. Example: `/picture-wall` -> `/picture-wall?` instead of `/`. + */ + public function updateMethodRelativeHomeLink(): bool + { + $link = trim($this->conf->get('general.header_link')); + if ($link[0] === '?') { + $link = './'. ltrim($link, '?'); + + $this->conf->set('general.header_link', $link, true, true); + } + + return true; + } }