Skip to content
Snippets Groups Projects
Commit cf931325 authored by deuce's avatar deuce
Browse files

Require font to be a directory (fix problem introduced by webctrl.ini)

parent 1deab712
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,12 @@ ...@@ -15,7 +15,12 @@
function insertCaptcha() { function insertCaptcha() {
var d = directory(webIni.webRoot + "/lib/captchaAnsis/*"); var d = directory(webIni.webRoot + "/lib/captchaAnsis/*");
var randomFont = Math.floor(Math.random() * (d.length)); var randomFont;
while(randomFont==undefined) {
randomFont = Math.floor(Math.random() * (d.length));
if(!file_isdir(d[randomFont]))
randomFont=undefined;
}
while(d[randomFont].match(/CVS/) != null) randomFont = Math.floor(Math.random() * (d.length)); while(d[randomFont].match(/CVS/) != null) randomFont = Math.floor(Math.random() * (d.length));
var f = directory(d[randomFont] + "*.a??"); // We're looking for .asc and .ans files. var f = directory(d[randomFont] + "*.a??"); // We're looking for .asc and .ans files.
var captchaString = ""; var captchaString = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment