diff --git a/lib/Constants.php b/lib/Constants.php index 74bedaf3..42262e5e 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -36,7 +36,6 @@ const EBOOKS_PER_PAGE = 12; const EBOOKS_MAX_STRING_LENGTH = 250; const EBOOKS_MAX_LONG_STRING_LENGTH = 500; const EBOOK_SINGLE_PAGE_SIZE_WARNING = 3 *1024 * 1024; // 3145728 -const EBOOK_EARLIEST_CREATION_DATE = new DateTimeImmutable('2014-01-01'); const ARTWORK_THUMBNAIL_HEIGHT = 350; const ARTWORK_THUMBNAIL_WIDTH = 350; diff --git a/lib/Ebook.php b/lib/Ebook.php index 354e184d..fbb7e648 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -1207,7 +1207,7 @@ class Ebook{ } if(isset($this->EbookCreated)){ - if($this->EbookCreated > $now || $this->EbookCreated < EBOOK_EARLIEST_CREATION_DATE){ + if($this->EbookCreated > $now){ $error->Add(new Exceptions\InvalidEbookCreatedDatetimeException($this->EbookCreated)); } } @@ -1216,7 +1216,7 @@ class Ebook{ } if(isset($this->EbookUpdated)){ - if($this->EbookUpdated > $now || $this->EbookUpdated < EBOOK_EARLIEST_CREATION_DATE){ + if($this->EbookUpdated > $now){ $error->Add(new Exceptions\InvalidEbookUpdatedDatetimeException($this->EbookUpdated)); } diff --git a/lib/Exceptions/InvalidEbookCreatedDatetimeException.php b/lib/Exceptions/InvalidEbookCreatedDatetimeException.php index 138f2d63..a72ded94 100644 --- a/lib/Exceptions/InvalidEbookCreatedDatetimeException.php +++ b/lib/Exceptions/InvalidEbookCreatedDatetimeException.php @@ -10,6 +10,6 @@ class InvalidEbookCreatedDatetimeException extends AppException{ public function __construct(DateTimeImmutable $createdDatetime){ /** @throws void */ $now = new DateTimeImmutable(); - $this->message = 'Invalid EbookCreated datetime. ' . $createdDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.'; + $this->message = 'Invalid EbookCreated datetime. ' . $createdDatetime->format('Y-m-d') . ' is after ' . $now->format('Y-m-d') . '.'; } } diff --git a/lib/Exceptions/InvalidEbookUpdatedDatetimeException.php b/lib/Exceptions/InvalidEbookUpdatedDatetimeException.php index 49d3aa49..cc912a8d 100644 --- a/lib/Exceptions/InvalidEbookUpdatedDatetimeException.php +++ b/lib/Exceptions/InvalidEbookUpdatedDatetimeException.php @@ -10,6 +10,6 @@ class InvalidEbookUpdatedDatetimeException extends AppException{ public function __construct(DateTimeImmutable $updatedDatetime){ /** @throws void */ $now = new DateTimeImmutable(); - $this->message = 'Invalid EbookUpdated datetime. ' . $updatedDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.'; + $this->message = 'Invalid EbookUpdated datetime. ' . $updatedDatetime->format('Y-m-d') . ' is after ' . $now->format('Y-m-d') . '.'; } } diff --git a/lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php b/lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php index 05d210b4..9f636b61 100644 --- a/lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php +++ b/lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php @@ -10,6 +10,6 @@ class InvalidGitCommitCreatedDatetimeException extends AppException{ public function __construct(DateTimeImmutable $createdDatetime){ /** @throws void */ $now = new DateTimeImmutable(); - $this->message = 'Invalid GitCommit Created datetime. ' . $createdDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.'; + $this->message = 'Invalid GitCommit Created datetime. ' . $createdDatetime->format('Y-m-d') . ' is after ' . $now->format('Y-m-d') . '.'; } } diff --git a/lib/GitCommit.php b/lib/GitCommit.php index 381022e8..a0db7fb9 100644 --- a/lib/GitCommit.php +++ b/lib/GitCommit.php @@ -37,7 +37,7 @@ class GitCommit{ } if(isset($this->Created)){ - if($this->Created > $now || $this->Created < EBOOK_EARLIEST_CREATION_DATE){ + if($this->Created > $now){ $error->Add(new Exceptions\InvalidGitCommitCreatedDatetimeException($this->Created)); } }