Skip to content

Commit c142d97

Browse files
committed
fix: change objectify function to return associative arrays instead of objects
1 parent 6692410 commit c142d97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CodeIgniter/Framework/database/drivers/json/json_driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ public function get()
12181218
// $content = array_map(function($record) {
12191219
// return (object) $record;
12201220
// }, $content);
1221-
$content = objectify($content, true);
1221+
$content = objectify($content, false);
12221222
break;
12231223
}
12241224

Core/helpers/webby_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ function objectify(array $array, $natural = false, $class = 'stdClass')
13841384

13851385
if (is_array($array)) {
13861386
$array = json_encode($array, JSON_THROW_ON_ERROR);
1387-
return json_decode($array, null, 512, JSON_THROW_ON_ERROR);
1387+
return json_decode($array, true, 512, JSON_THROW_ON_ERROR);
13881388
}
13891389

13901390
return (object)[]; // return empty object if condition not met

0 commit comments

Comments
 (0)