- initiate its status to false when the link is created
- if not defined, initiate its status to false (can happen if the updater hasn't run)
This is a backport of https://github.com/shaarli/Shaarli/pull/1270
Original author information:
commit
b790f900c937d0d8f6eccc15d2b4c26023f3d276
Author: ArthurHoaro <arthur@hoa.ro>
Date: Sat Feb 9 14:04:16 2019 +0100
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
),
'private'=>0,
'created'=> new DateTime(),
),
'private'=>0,
'created'=> new DateTime(),
- 'tags'=>'opensource software'
+ 'tags'=>'opensource software',
+ 'sticky' => false,
);
$link['shorturl'] = link_small_hash($link['created'], $link['id']);
$this->links[1] = $link;
);
$link['shorturl'] = link_small_hash($link['created'], $link['id']);
$this->links[1] = $link;
'private'=>1,
'created'=> new DateTime('1 minute ago'),
'tags'=>'secretstuff',
'private'=>1,
'created'=> new DateTime('1 minute ago'),
'tags'=>'secretstuff',
);
$link['shorturl'] = link_small_hash($link['created'], $link['id']);
$this->links[0] = $link;
);
$link['shorturl'] = link_small_hash($link['created'], $link['id']);
$this->links[0] = $link;
$link['real_url'] = $link['url'];
}
$link['real_url'] = $link['url'];
}
+ $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false;
+
// To be able to load links before running the update, and prepare the update
if (! isset($link['created'])) {
$link['id'] = $link['linkdate'];
// To be able to load links before running the update, and prepare the update
if (! isset($link['created'])) {
$link['id'] = $link['linkdate'];
$link['thumbnail'] = $thumbnailer->get($url);
}
$link['thumbnail'] = $thumbnailer->get($url);
}
+ $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false;
+
$pluginManager->executeHooks('save_link', $link);
$LINKSDB[$id] = $link;
$pluginManager->executeHooks('save_link', $link);
$LINKSDB[$id] = $link;