X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FLinkDB.php;h=1e4d7ce88421aa8871264487ddf329f87e4e2d15;hb=bc5f1597eb1526731662a930e3fd8aafbd7b01af;hp=4cee2af9942559fd122189687058ddddc1fc4ebf;hpb=2109bb9d9a355787f8beea8cbfaed2eb1d53283f;p=github%2Fshaarli%2FShaarli.git diff --git a/application/LinkDB.php b/application/LinkDB.php index 4cee2af9..1e4d7ce8 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -144,10 +144,10 @@ class LinkDB implements Iterator, Countable, ArrayAccess if (!isset($value['id']) || empty($value['url'])) { die('Internal Error: A link should always have an id and URL.'); } - if ((! empty($offset) && ! is_int($offset)) || ! is_int($value['id'])) { + if (($offset !== null && ! is_int($offset)) || ! is_int($value['id'])) { die('You must specify an integer as a key.'); } - if (! empty($offset) && $offset !== $value['id']) { + if ($offset !== null && $offset !== $value['id']) { die('Array offset and link ID must be equal.'); }