Merge pull request #1199 from ArthurHoaro/hotfix/thumbnails-edit-link
Fix issue 'You are not authorized to add a link' with thumbnails enabled
This commit is contained in:
commit
1c88a7b33e
2 changed files with 3 additions and 3 deletions
|
@ -502,7 +502,7 @@ public function updateMethodWebThumbnailer()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$thumbnailsEnabled = $this->conf->get('thumbnail.enable_thumbnails', true);
|
$thumbnailsEnabled = extension_loaded('gd') && $this->conf->get('thumbnail.enable_thumbnails', true);
|
||||||
$this->conf->set('thumbnails.mode', $thumbnailsEnabled ? Thumbnailer::MODE_ALL : Thumbnailer::MODE_NONE);
|
$this->conf->set('thumbnails.mode', $thumbnailsEnabled ? Thumbnailer::MODE_ALL : Thumbnailer::MODE_NONE);
|
||||||
$this->conf->set('thumbnails.width', 125);
|
$this->conf->set('thumbnails.width', 125);
|
||||||
$this->conf->set('thumbnails.height', 90);
|
$this->conf->set('thumbnails.height', 90);
|
||||||
|
|
|
@ -1635,9 +1635,9 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
|
||||||
uasort($taglist, 'strcasecmp');
|
uasort($taglist, 'strcasecmp');
|
||||||
$link['taglist'] = $taglist;
|
$link['taglist'] = $taglist;
|
||||||
|
|
||||||
// Thumbnails enabled, not a note,
|
// Logged in, thumbnails enabled, not a note,
|
||||||
// and (never retrieved yet or no valid cache file)
|
// and (never retrieved yet or no valid cache file)
|
||||||
if ($thumbnailsEnabled && $link['url'][0] != '?'
|
if ($loginManager->isLoggedIn() && $thumbnailsEnabled && $link['url'][0] != '?'
|
||||||
&& (! isset($link['thumbnail']) || ($link['thumbnail'] !== false && ! is_file($link['thumbnail'])))
|
&& (! isset($link['thumbnail']) || ($link['thumbnail'] !== false && ! is_file($link['thumbnail'])))
|
||||||
) {
|
) {
|
||||||
$elem = $LINKSDB[$keys[$i]];
|
$elem = $LINKSDB[$keys[$i]];
|
||||||
|
|
Loading…
Reference in a new issue