From 3adbdc2a83e6b77a4ca62094c5d857524e39d211 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 16 Oct 2020 13:06:06 +0200 Subject: Inject ROOT_PATH in plugin instead of regenerating it everywhere --- plugins/wallabag/wallabag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/wallabag/wallabag.php') diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index 805c1ad9..d0df3501 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php @@ -45,7 +45,7 @@ function hook_wallabag_render_linklist($data, $conf) $wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html'); $linkTitle = t('Save to wallabag'); - $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; + $path = ($data['_ROOT_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; foreach ($data['links'] as &$value) { $wallabag = sprintf( -- cgit v1.2.3 From 358cb20bcba3cb7b0ce2a3000fb7026465a10386 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 24 Oct 2020 16:25:06 +0200 Subject: Plugin wallabag: minor improvements - hide the wallabag icon for logged out users - set API V2 as default parameter - fix URL encoding issue with special chars Fixes #1147 --- plugins/wallabag/wallabag.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/wallabag/wallabag.php') diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index d0df3501..8cd3f4ad 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php @@ -22,6 +22,7 @@ function wallabag_init($conf) 'Please define the "WALLABAG_URL" setting in the plugin administration page.'); return array($error); } + $conf->setEmpty('plugins.WALLABAG_URL', '2'); } /** @@ -35,7 +36,7 @@ function wallabag_init($conf) function hook_wallabag_render_linklist($data, $conf) { $wallabagUrl = $conf->get('plugins.WALLABAG_URL'); - if (empty($wallabagUrl)) { + if (empty($wallabagUrl) || !$data['_LOGGEDIN_']) { return $data; } @@ -51,7 +52,7 @@ function hook_wallabag_render_linklist($data, $conf) $wallabag = sprintf( $wallabagHtml, $wallabagInstance->getWallabagUrl(), - urlencode($value['url']), + urlencode(unescape($value['url'])), $path, $linkTitle ); -- cgit v1.2.3 From 53054b2bf6a919fd4ff9b44b6ad1986f21f488b6 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 22 Sep 2020 20:25:47 +0200 Subject: Apply PHP Code Beautifier on source code for linter automatic fixes --- plugins/wallabag/wallabag.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/wallabag/wallabag.php') diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index 8cd3f4ad..f2003cb9 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php @@ -1,4 +1,5 @@ get('plugins.WALLABAG_URL'); if (empty($wallabagUrl)) { - $error = t('Wallabag plugin error: '. + $error = t('Wallabag plugin error: ' . 'Please define the "WALLABAG_URL" setting in the plugin administration page.'); - return array($error); + return [$error]; } $conf->setEmpty('plugins.WALLABAG_URL', '2'); } -- cgit v1.2.3