Commit 65af6c8c authored by Piers Harding's avatar Piers Harding Committed by Robert Lyon

Bug 1577259: fix dynamic property references in dwoo for php7

behatnotneeded

Change-Id: Iac965f8ce3999be6ae839a10cf5da7b2fd3b0487
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 92b6e408)
parent d8bafadb
......@@ -8,4 +8,4 @@ This library is used for all the templating.
Changes:
* None
* Make dwoo PHP7 compatable by fixing dynamic property references
......@@ -1261,8 +1261,8 @@ class Dwoo_Core
return null;
}
} else {
if (is_object($data) && ($safeRead === false || isset($data->$m[2][$k]))) {
$data = $data->$m[2][$k];
if (is_object($data) && ($safeRead === false || isset($data->{$m[2][$k]}))) {
$data = $data->{$m[2][$k]};
} else {
return null;
}
......@@ -1434,7 +1434,7 @@ class Dwoo_Core
}
} elseif ($sep === '->') {
if (is_object($cur)) {
$cur = $cur->$m[2][$k];
$cur = $cur->{$m[2][$k]};
} else {
return null;
}
......@@ -1480,7 +1480,7 @@ class Dwoo_Core
if (is_object($cur) === false) {
$cur = new stdClass;
}
$cur =& $cur->$m[2][$k];
$cur =& $cur->{$m[2][$k]};
} else {
return false;
}
......@@ -1495,7 +1495,7 @@ class Dwoo_Core
if (is_object($cur) === false) {
$cur = new stdClass;
}
$cur->$last[1] = $value;
$cur->{$last[1]} = $value;
} else {
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment