Put regex rules between single quotes

This commit is contained in:
jo 2021-10-12 11:09:46 +02:00
parent d52c6184b9
commit f05c228f1d
7 changed files with 16 additions and 16 deletions

View file

@ -483,7 +483,7 @@ class CcFiles extends BaseCcFiles
private static function stripTimeStampFromYearTag($metadata)
{
if (isset($metadata['year'])) {
if (preg_match("/^(\d{4})-(\d{2})-(\d{2})(?:\s+(\d{2}):(\d{2}):(\d{2}))?$/", $metadata['year'])) {
if (preg_match('/^(\d{4})-(\d{2})-(\d{2})(?:\s+(\d{2}):(\d{2}):(\d{2}))?$/', $metadata['year'])) {
$metadata['year'] = substr($metadata['year'], 0, 4);
}
}