Skip to content

Commit 790381b

Browse files
authored
Replace YYYY in the copyright line by the current year
Follow up for #5004
1 parent 1c874bd commit 790381b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/code/Magento/Theme/Block/Html/Footer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getCopyright()
9393
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
9494
);
9595
}
96-
return __($this->_copyright);
96+
return $this->replaceCurrentYear(__($this->_copyright));
9797
}
9898

9999
/**
@@ -133,4 +133,12 @@ protected function getCacheLifetime()
133133
{
134134
return parent::getCacheLifetime() ?: 3600;
135135
}
136+
137+
/**
138+
* Replace YYYY by the current year
139+
*/
140+
private function replaceCurrentYear($text)
141+
{
142+
return str_replace('YYYY', (new \DateTime())->format('Y'), $text)
143+
}
136144
}

0 commit comments

Comments
 (0)