Fix broken comparison logic for years
The current year was compared to seconds since 1970 instead of another year...
This commit is contained in:
parent
fbcf66d906
commit
5d300d02bd
|
@ -49,16 +49,17 @@ final class MDPlausiForLegalStatus {
|
|||
private function _determineExpectedStatus():string {
|
||||
|
||||
$currentYear = (int)date("Y");
|
||||
$deathYearOfLastCreator = (int)date("Y", $this->_death_of_last_creator);
|
||||
|
||||
if (!isset($this->_death_of_last_creator)) {
|
||||
if (!isset($deathYearOfLastCreator)) {
|
||||
return 'any';
|
||||
}
|
||||
|
||||
if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN > $this->_death_of_last_creator) {
|
||||
if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN > $deathYearOfLastCreator) {
|
||||
return 'pd';
|
||||
}
|
||||
|
||||
if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN_CERTAIN < $this->_death_of_last_creator) {
|
||||
if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN_CERTAIN < $deathYearOfLastCreator) {
|
||||
return 'restricted';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user