Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix #2367
  • Loading branch information
JC5 committed Aug 2, 2019
1 parent 2ddf48f commit e80d616
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/Support/Import/JobConfiguration/FinTS/NewFinTSJobHandler.php
Expand Up @@ -60,6 +60,9 @@ public function configureJob(array $data): MessageBag
$config['fints_password'] = (string)(Crypt::encrypt($data['fints_password']) ?? '');
$config['apply-rules'] = 1 === (int)$data['apply_rules'];

// sanitize FinTS URL.
$config['fints_url'] = $this->validURI($config['fints_url']) ? $config['fints_url'] : '';

$this->repository->setConfiguration($this->importJob, $config);


Expand Down Expand Up @@ -108,4 +111,21 @@ public function setImportJob(ImportJob $importJob): void
$this->repository->setUser($importJob->user);
}

/**
* @param string $fints_url
*
* @return bool
*/
private function validURI(string $fintsUri): bool
{
$res = filter_var($fintsUri, FILTER_VALIDATE_URL);
if (false === $res) {
return false;
}
$scheme = parse_url($fintsUri, PHP_URL_SCHEME);

return 'https' === $scheme;
}


}

0 comments on commit e80d616

Please sign in to comment.