mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Fix #2367
This commit is contained in:
@@ -60,6 +60,9 @@ class NewFinTSJobHandler implements FinTSConfigurationInterface
|
|||||||
$config['fints_password'] = (string)(Crypt::encrypt($data['fints_password']) ?? '');
|
$config['fints_password'] = (string)(Crypt::encrypt($data['fints_password']) ?? '');
|
||||||
$config['apply-rules'] = 1 === (int)$data['apply_rules'];
|
$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);
|
$this->repository->setConfiguration($this->importJob, $config);
|
||||||
|
|
||||||
|
|
||||||
@@ -108,4 +111,21 @@ class NewFinTSJobHandler implements FinTSConfigurationInterface
|
|||||||
$this->repository->setUser($importJob->user);
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user