diff options
author | VirtualTam <virtualtam@flibidi.net> | 2019-04-15 23:57:08 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2019-04-15 23:57:08 +0200 |
commit | 1cc5eaf9dee0e71aefbce1ff0f28c86ff320c053 (patch) | |
tree | c139d7fefc0217b2f18fbb41cb4222879585d3e0 /application | |
parent | 0ed9396bfa12f086369b52cdc0742e3fe72273ec (diff) | |
download | Shaarli-1cc5eaf9dee0e71aefbce1ff0f28c86ff320c053.tar.gz Shaarli-1cc5eaf9dee0e71aefbce1ff0f28c86ff320c053.tar.zst Shaarli-1cc5eaf9dee0e71aefbce1ff0f28c86ff320c053.zip |
backport: Fix a warning if links sticky status isn't set
- 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>
Diffstat (limited to 'application')
-rw-r--r-- | application/LinkDB.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index 4bbc2950..803757ca 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -259,7 +259,8 @@ You use the community supported version of the original Shaarli project, by Seba | |||
259 | ), | 259 | ), |
260 | 'private'=>0, | 260 | 'private'=>0, |
261 | 'created'=> new DateTime(), | 261 | 'created'=> new DateTime(), |
262 | 'tags'=>'opensource software' | 262 | 'tags'=>'opensource software', |
263 | 'sticky' => false, | ||
263 | ); | 264 | ); |
264 | $link['shorturl'] = link_small_hash($link['created'], $link['id']); | 265 | $link['shorturl'] = link_small_hash($link['created'], $link['id']); |
265 | $this->links[1] = $link; | 266 | $this->links[1] = $link; |
@@ -272,6 +273,7 @@ You use the community supported version of the original Shaarli project, by Seba | |||
272 | 'private'=>1, | 273 | 'private'=>1, |
273 | 'created'=> new DateTime('1 minute ago'), | 274 | 'created'=> new DateTime('1 minute ago'), |
274 | 'tags'=>'secretstuff', | 275 | 'tags'=>'secretstuff', |
276 | 'sticky' => false, | ||
275 | ); | 277 | ); |
276 | $link['shorturl'] = link_small_hash($link['created'], $link['id']); | 278 | $link['shorturl'] = link_small_hash($link['created'], $link['id']); |
277 | $this->links[0] = $link; | 279 | $this->links[0] = $link; |
@@ -323,6 +325,8 @@ You use the community supported version of the original Shaarli project, by Seba | |||
323 | $link['real_url'] = $link['url']; | 325 | $link['real_url'] = $link['url']; |
324 | } | 326 | } |
325 | 327 | ||
328 | $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false; | ||
329 | |||
326 | // To be able to load links before running the update, and prepare the update | 330 | // To be able to load links before running the update, and prepare the update |
327 | if (! isset($link['created'])) { | 331 | if (! isset($link['created'])) { |
328 | $link['id'] = $link['linkdate']; | 332 | $link['id'] = $link['linkdate']; |