Skip to content

Commit

Permalink
Fixed a bug where $val was wrongfully overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
saibotd authored May 4, 2018
1 parent e6198f4 commit e871808
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Resources/contao/classes/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public static function toObj($instance, $fields = null)
}
$imageSize = null;
$images = [];
foreach ($obj as $key => &$val) {
$originalVal = $val;
foreach ($obj as $key => $val) {
if ($fields && !in_array($key, $fields)) {
unset($obj[$key]);
continue;
Expand All @@ -52,6 +51,7 @@ public static function toObj($instance, $fields = null)
if (strpos($key, 'SRC') !== false && $val) {
$images[$key] = $val;
}
$obj[$key] = $val;
}
foreach($images as $key => $image){
if (is_array($image)) {
Expand Down

0 comments on commit e871808

Please sign in to comment.