Otherwise the script will pick up on any directory which _contains_ a
date, not just those which _are_ one.
) {
// 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 {