Fix offset check with link ID = 0
This commit is contained in:
parent
2109bb9d9a
commit
bc5f1597eb
1 changed files with 2 additions and 2 deletions
|
@ -144,10 +144,10 @@ public function offsetSet($offset, $value)
|
||||||
if (!isset($value['id']) || empty($value['url'])) {
|
if (!isset($value['id']) || empty($value['url'])) {
|
||||||
die('Internal Error: A link should always have an id and 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.');
|
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.');
|
die('Array offset and link ID must be equal.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue