Skip to content

Commit 7505bed

Browse files
authored
isValidRev(): reject revs with more than one dash (#8933)
Follow-up to #8931
1 parent 3c85203 commit 7505bed

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/node_modules/pouchdb-core/src/adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function isNotSingleDoc(doc) {
195195
}
196196

197197
function isValidRev(rev) {
198-
return typeof rev === 'string' && /^\d+-/.test(rev);
198+
return typeof rev === 'string' && /^\d+-[^-]*$/.test(rev);
199199
}
200200

201201
class AbstractPouchDB extends EventEmitter {

tests/integration/test.basics.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ adapters.forEach(function (adapter) {
271271
[
272272
() => '-format',
273273
() => 'bad-format',
274+
() => '1-ok-bad',
274275
() => ({}),
275276
() => ({ toString:'2-abc' }),
276277
() => ({ toString:'2-abc', indexOf:777 }),

0 commit comments

Comments
 (0)