Skip to content

Commit

Permalink
[Configuration] Use FILTER_VALIDATE_EMAIL on admin/email
Browse files Browse the repository at this point in the history
This prevents including arbitrary data as email address.
  • Loading branch information
logmanoriginal committed Nov 10, 2018
1 parent 4713fb6 commit 2bb1316
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public static function loadConfiguration() {
if(!is_string(self::getConfig('authentication', 'password')))
die('Parameter [authentication] => "password" is not a valid string! Please check "config.ini.php"!');

if(!empty(self::getConfig('admin', 'email'))
&& !filter_var(self::getConfig('admin', 'email'), FILTER_VALIDATE_EMAIL))
die('Parameter [admin] => "email" is not a valid email address! Please check "config.ini.php"!');

}

public static function getConfig($category, $key) {
Expand Down

0 comments on commit 2bb1316

Please sign in to comment.