Skip to content

Commit

Permalink
fix xss on module api call in value parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Jan 19, 2022
1 parent 6e9fcaa commit fc7e1a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MicroweberPackages/App/Http/Controllers/ApiController.php
Expand Up @@ -17,9 +17,6 @@
class ApiController extends FrontendController
{




public function api_html()
{
if (!defined('MW_API_HTML_OUTPUT')) {
Expand Down Expand Up @@ -609,12 +606,14 @@ public function module()

$request_data = array_merge($_GET, $_POST);


// sanitize attributes
if($request_data){
$request_data_new = [];
$antixss = new AntiXSS();
foreach ($request_data as $k=>$v){

$v = $antixss->xss_clean($v);

if(is_string($k)){
$k = $antixss->xss_clean($k);
if($k){
Expand All @@ -623,6 +622,7 @@ public function module()
} else {
$request_data_new[$k] = $v;
}

}
$request_data = $request_data_new;
}
Expand Down

0 comments on commit fc7e1a0

Please sign in to comment.