]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/updater/Updater.php
Process picwall rendering through Slim controller + UT
[github/shaarli/Shaarli.git] / application / updater / Updater.php
index 95654d81da96c0d23c2d26424c47983b39c25961..4bbcb9f270664a8e11266716548f502368765aec 100644 (file)
@@ -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;
+    }
 }