Accept two missing letters in object keys (but don't use them yet)
Also: - 'T' doesn't come after 'X' (but does probably appear disproportionally in existing object keys) This commit has been brought to you by the letters 'L' and 'Y'.
This commit is contained in:
parent
5e6c90d873
commit
beaaf8fc6b
|
@ -536,8 +536,7 @@ Zotero.Creator.prototype._checkValue = function (field, value) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'key':
|
case 'key':
|
||||||
var re = /^[23456789ABCDEFGHIJKMNPQRSTUVWXTZ]{8}$/
|
if (!Zotero.ID.isValidKey(value)) {
|
||||||
if (!re.test(value)) {
|
|
||||||
this._invalidValueError(field, value);
|
this._invalidValueError(field, value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -87,11 +87,18 @@ Zotero.ID_Tracker = function () {
|
||||||
|
|
||||||
|
|
||||||
function getKey() {
|
function getKey() {
|
||||||
var baseString = "23456789ABCDEFGHIJKMNPQRSTUVWXTZ";
|
// TODO: add 'L' and 'Y' after 3.0.11 cut-off
|
||||||
|
var baseString = "23456789ABCDEFGHIJKMNPQRSTUVWXZ";
|
||||||
return Zotero.randomString(8, baseString);
|
return Zotero.randomString(8, baseString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.isValidKey = function () {
|
||||||
|
var re = /^[23456789ABCDEFGHIJKLMNPQRSTUVWXYZ]{8}$/
|
||||||
|
return re.test(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getBigInt(max) {
|
function getBigInt(max) {
|
||||||
if (!max) {
|
if (!max) {
|
||||||
max = 9007199254740991;
|
max = 9007199254740991;
|
||||||
|
|
|
@ -1069,7 +1069,7 @@ Zotero.Utilities = {
|
||||||
**/
|
**/
|
||||||
"randomString":function(len, chars) {
|
"randomString":function(len, chars) {
|
||||||
if (!chars) {
|
if (!chars) {
|
||||||
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
|
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz";
|
||||||
}
|
}
|
||||||
if (!len) {
|
if (!len) {
|
||||||
len = 8;
|
len = 8;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user