) {
// Iterate over each directory and process the ones which are
// dates.
- if (!isDirectory || !/[0-9]{4}-[0-9]{2}-[0-9]{2}/u.test(date)) {
+ if (!isDirectory || !/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/u.test(date)) {
// This isn’t a dated directory.
continue;
} else {