diff options
author | VirtualTam <virtualtam@flibidi.net> | 2015-06-27 14:57:44 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2015-07-09 00:44:19 +0200 |
commit | 9186ab95943b7c2467a0f27f30bed9db3c589b9d (patch) | |
tree | cfc8e4d2c8469ac16910c18d59a07b23d0348fbe /application/LinkDB.php | |
parent | 46d83c20d77276e9e94c54e31b29222f762e13dd (diff) | |
download | Shaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.tar.gz Shaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.tar.zst Shaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.zip |
LinkDB::filterDay(): check input date format
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r-- | application/LinkDB.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index a673b086..82763618 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -375,7 +375,10 @@ You use the community supported version of the original Shaarli project, by Seba | |||
375 | */ | 375 | */ |
376 | public function filterDay($day) | 376 | public function filterDay($day) |
377 | { | 377 | { |
378 | // TODO: check input format | 378 | if (! checkDateFormat('Ymd', $day)) { |
379 | throw new Exception('Invalid date format'); | ||
380 | } | ||
381 | |||
379 | $filtered = array(); | 382 | $filtered = array(); |
380 | foreach ($this->links as $l) { | 383 | foreach ($this->links as $l) { |
381 | if (startsWith($l['linkdate'], $day)) { | 384 | if (startsWith($l['linkdate'], $day)) { |