From 5e9ad29f3ceecba86e9763aed5080b10fe020c46 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 4 Jun 2024 13:38:46 +0000 Subject: [PATCH] - Filling values of context if vars exists within it --- src/Method/FormContext.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Method/FormContext.php b/src/Method/FormContext.php index 9fb3f75..3dcab6b 100644 --- a/src/Method/FormContext.php +++ b/src/Method/FormContext.php @@ -147,10 +147,13 @@ class FormContext implements FormContextInterface protected function fillValues() : void { + # Skipping overrides of this particular class vars as a security measure + $skipping = array_keys(array_change_key_case(get_class_vars(FormContext::class), CASE_LOWER)); + foreach($this->values as $property => $value) { - if (property_exists($this, $property)) { + if ( ! in_array(strtolower($property), $skipping) && property_exists($this, $property)) { $this->$property = $value; } } } -} \ No newline at end of file +}