From 3f36ca2a9b272ba2a8d073e679fb17c9c764a6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Thu, 25 Aug 2016 17:52:44 +0200 Subject: [PATCH] [core] unexpected input generates a fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit because paranoïa is the way to security ! Should this be optional ? Signed-off-by: Pierre Mazière --- lib/Bridge.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Bridge.php b/lib/Bridge.php index b13ab52..55c85c0 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -146,8 +146,10 @@ abstract class BridgeAbstract implements BridgeInterface { protected function validateData(&$data){ $validated=true; foreach($data as $name=>$value){ + $registered=false; foreach($this->parameters as $context=>$set){ if(array_key_exists($name,$set)){ + $registered=true; if(!isset($set[$name]['type'])){ $set[$name]['type']='text'; } @@ -197,6 +199,9 @@ abstract class BridgeAbstract implements BridgeInterface { } } } + if(!$registered){ + $validated=false; + } } return $validated;