Skip to content

Commit f181a7e

Browse files
hikerpigRokt33r
authored andcommitted
more strict regex pattern in pathname matching, fix #3183
1 parent 6b1c595 commit f181a7e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

browser/main/Detail/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,14 @@ class Detail extends React.Component {
5050
const searchStr = params.searchword
5151
displayedNotes = searchStr === undefined || searchStr === '' ? allNotes
5252
: searchFromNotes(allNotes, searchStr)
53-
}
54-
55-
if (location.pathname.match(/\/tags/)) {
53+
} else if (location.pathname.match(/^\/tags/)) {
5654
const listOfTags = params.tagname.split(' ')
5755
displayedNotes = data.noteMap.map(note => note).filter(note =>
5856
listOfTags.every(tag => note.tags.includes(tag))
5957
)
6058
}
6159

62-
if (location.pathname.match(/\/trashed/)) {
60+
if (location.pathname.match(/^\/trashed/)) {
6361
displayedNotes = trashedNotes
6462
} else {
6563
displayedNotes = _.differenceWith(displayedNotes, trashedNotes, (note, trashed) => note.key === trashed.key)

0 commit comments

Comments
 (0)