diff --git a/chrome/content/zotero/tools/data_generator.html b/chrome/content/zotero/tools/data_generator.html index 5cadf4a1e..e87f9309a 100644 --- a/chrome/content/zotero/tools/data_generator.html +++ b/chrome/content/zotero/tools/data_generator.html @@ -79,13 +79,16 @@ var rand = Zotero.Utilities.rand; function randStr(min, max) { - return Zotero.Utilities.randomString( - rand(min, max), - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - + "éØü" - + "漢字" - + " " - ); + var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + "éØü" + + "漢字" + + " " + do { + var rnd = Zotero.Utilities.randomString(rand(min, max), chars); + } + // Make sure string isn't all spaces + while (rnd.trim().length == 0); + return rnd; } function addCreatorOfType(creators, creatorType) {