X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FLinkDB.php;h=0d3c85bd9815e2c879d8b18160441dfd19fd80f5;hb=f9ff7f1b69f19b42569ffa67280807ba56f5d48a;hp=2fb15040321339cd31aa127aad692416f33e5110;hpb=d16ca2e22f3d7325fc9593fccd8523eebe226567;p=github%2Fshaarli%2FShaarli.git diff --git a/application/LinkDB.php b/application/LinkDB.php index 2fb15040..0d3c85bd 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -138,10 +138,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.'); }