summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-09-13 20:34:15 -0400
committerMalf Furious <m@lfurio.us>2016-09-13 20:34:15 -0400
commit63e56817123810e93a3d5cd0e13a70b8c47cacc5 (patch)
tree4fdbd4e94670ad6c5717c0b38f46f43245dd1643 /app/class
parentde8dc835d7442a8bdc47d181ee9385fe7d16209d (diff)
downloadscrott-63e56817123810e93a3d5cd0e13a70b8c47cacc5.tar.gz
scrott-63e56817123810e93a3d5cd0e13a70b8c47cacc5.zip
Changes to the handling of indirect variables, properties, and methods
To maintain forward compatability with newer versions of PHP (and since my dev environment is now running PHP 7), this patch is made to address the following breaking change from PHP 5: PHP 7 now uses an abstract syntax tree when parsing source files. This has permitted many improvements to the language which were previously impossible due to limitations in the parser used in earlier versions of PHP, but has resulted in the removal of a few special cases for consistency reasons, which has resulted in backward compatibility breaks. Indirect access to variables, properties, and methods will now be evaluated strictly in left-to-right order, as opposed to the previous mix of special cases.
Diffstat (limited to 'app/class')
-rw-r--r--app/class/form.class.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php
index f0d660a..8bb6506 100644
--- a/app/class/form.class.php
+++ b/app/class/form.class.php
@@ -123,10 +123,10 @@ class Form
foreach ($this->textFields as $fld)
{
if (isset($input[$fld['name']]) && $input[$fld['name']] != "")
- $this->$fld['name'] = htmlEntities($input[$fld['name']], ENT_QUOTES);
+ $this->{$fld['name']} = htmlEntities($input[$fld['name']], ENT_QUOTES);
else if (!is_null($fld['deflt']))
- $this->$fld['name'] = $fld['deflt'];
+ $this->{$fld['name']} = $fld['deflt'];
else if ($fld['req'])
$this->logError($fld['name'] . " is required");
@@ -161,11 +161,11 @@ class Form
continue;
}
- $this->$fld['name'] = $input[$fld['name']];
+ $this->{$fld['name']} = $input[$fld['name']];
}
else if (!is_null($fld['deflt']))
- $this->$fld['name'] = $fld['deflt'];
+ $this->{$fld['name']} = $fld['deflt'];
else if ($fld['req'])
$this->logError($fld['name'] . " is required");
@@ -182,11 +182,11 @@ class Form
continue;
}
- $this->$fld['name'] = $input[$fld['name']];
+ $this->{$fld['name']} = $input[$fld['name']];
}
else if (!is_null($fld['deflt']))
- $this->$fld['name'] = $fld['deflt'];
+ $this->{$fld['name']} = $fld['deflt'];
else if ($fld['req'])
$this->logError($fld['name'] . " is required");