From e1d7ad44e0e637330876b62db1e0fa7e942f9a91 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 22 Oct 2020 01:36:00 +0200 Subject: [PATCH] Make the bookmarklet compatible with ugly URLs --- classes/Factory/ViewFactory.php | 2 +- templates/index.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Factory/ViewFactory.php b/classes/Factory/ViewFactory.php index dc60ad0..a20b08e 100644 --- a/classes/Factory/ViewFactory.php +++ b/classes/Factory/ViewFactory.php @@ -83,7 +83,7 @@ class ViewFactory $view->offsetSet('canonical', self::getCanonicalUrl($request)); $view->offsetSet('locale', $container->get('locale')->getLocale()); $view->offsetSet('config', $container->get('config')); - $view->offsetSet('domain', $uri->withPath('')->withBasePath('')); + $view->offsetSet('domain', rtrim($uri->withPath('')->withBasePath(''), '/')); return $view; } diff --git a/templates/index.tpl b/templates/index.tpl index b26eb64..1f8af78 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -42,7 +42,7 @@

{t}Drag this to your bookmarks bar:{/t}

{t}Bookmarklet{/t} + href="javascript:window.location='{$domain}{path_for name='info' queryParams=['url' => '%url%']}'.replace('%url%', encodeURIComponent(location.href));">{t}Bookmarklet{/t}