<?php
+
/**
* Wallabag plugin
*/
{
$wallabagUrl = $conf->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');
}
/**
function hook_wallabag_render_linklist($data, $conf)
{
$wallabagUrl = $conf->get('plugins.WALLABAG_URL');
- if (empty($wallabagUrl)) {
+ if (empty($wallabagUrl) || !$data['_LOGGEDIN_']) {
return $data;
}
$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(
$wallabagHtml,
$wallabagInstance->getWallabagUrl(),
- urlencode($value['url']),
+ urlencode(unescape($value['url'])),
$path,
$linkTitle
);