From f5d53caaf7d8e8203ca7d35d2bf75f42ac7d3a8a Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Mon, 19 Oct 2020 15:51:46 -0400 Subject: [PATCH] Don't allow date separators that could be used in some date formats --- modules/renderer/photos.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/renderer/photos.js b/modules/renderer/photos.js index bc4d984a1..865797e5e 100644 --- a/modules/renderer/photos.js +++ b/modules/renderer/photos.js @@ -160,8 +160,8 @@ export function rendererPhotos(context) { photos.init = function() { var hash = utilStringQs(window.location.hash); if (hash.photo_dates) { - // expect format like `photo_dates=2019-01-01_2020-12-31`, but allow a few different separators - var parts = /^(.*)[–\/_+:](.*)$/g.exec(hash.photo_dates.trim()); + // expect format like `photo_dates=2019-01-01_2020-12-31`, but allow a couple different separators + var parts = /^(.*)[–_](.*)$/g.exec(hash.photo_dates.trim()); this.setDateFilter('fromDate', parts && parts.length >= 2 && parts[1], false); this.setDateFilter('toDate', parts && parts.length >= 3 && parts[2], false); }