Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions system/Helpers/array_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ function dot_array_search(string $index, array $array)
*/
function _array_search_dot(array $indexes, array $array)
{
// If index is empty, returns null.
if ($indexes === []) {
return null;
}

// Grab the current index
$currentIndex = $indexes ? array_shift($indexes) : null;
$intCurrentIndex = (int) $currentIndex;
$currentIndex = array_shift($indexes);

if (empty($currentIndex) && $intCurrentIndex !== 0 || (! isset($array[$currentIndex]) && $currentIndex !== '*')) {
if (! isset($array[$currentIndex]) && $currentIndex !== '*') {
return null;
}

Expand Down