Skip to content

Commit

Permalink
filter var for url
Browse files Browse the repository at this point in the history
  • Loading branch information
loveorigami committed Dec 21, 2018
1 parent 2ac1eb2 commit 3a1e774
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"type": "yii2-extension",
"license": "MIT",
"version": "3.1.4",
"version": "3.1.5",
"support": {
"source": "https://github.com/loveorigami/yii2-plugins-system",
"issues": "https://github.com/loveorigami/yii2-plugins-system/issues"
Expand Down
2 changes: 1 addition & 1 deletion src/core/extralinks/ExternalLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ protected static function initConfig(array $data)
}
}

}
}
7 changes: 6 additions & 1 deletion src/core/extralinks/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ public function actionRedirect()
if ($config['enabledB64Encode']) {
$url = base64_decode($url);
}

if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
throw new BadRequestHttpException;
}

return $this->redirect($url);
}

throw new BadRequestHttpException;
}
}
}

0 comments on commit 3a1e774

Please sign in to comment.