From f23838dcfdef6fb4793a4ca34bbda9eb252d6ec5 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 12 Mar 2018 09:22:26 +0100 Subject: [PATCH 1/2] Also normalise request data on front-end user profile save --- components/com_users/controllers/profile.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index 594ee0b404ac6..45b13f5013e55 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -113,6 +113,14 @@ public function save() return false; } + // Send an object which can be modified through the plugin event + $objData = (object) $requestData; + $app->triggerEvent( + 'onContentNormaliseRequestData', + array($this->option . '.' . $this->context, $objData, $form) + ); + $requestData = (array) $objData; + // Validate the posted data. $data = $model->validate($form, $requestData); From 6b13036ac35784a7ba03ae72a88c73f77c3431f0 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 12 Mar 2018 16:18:48 +0100 Subject: [PATCH 2/2] correct context and option --- components/com_users/controllers/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index 45b13f5013e55..3175402a60221 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -117,7 +117,7 @@ public function save() $objData = (object) $requestData; $app->triggerEvent( 'onContentNormaliseRequestData', - array($this->option . '.' . $this->context, $objData, $form) + array('com_users.user', $objData, $form) ); $requestData = (array) $objData;