From 4c1c8ee4bcdca1577d2affa417063fe55a978a02 Mon Sep 17 00:00:00 2001 From: echicken <> Date: Mon, 15 Aug 2011 17:11:30 +0000 Subject: [PATCH] Didn't account for the presence of the 'CVS' subdirectory in captchaAnsis and subdirectories. --- web/root/ecWeb/lib/captchaLib.ssjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/root/ecWeb/lib/captchaLib.ssjs b/web/root/ecWeb/lib/captchaLib.ssjs index a0b5953628..a0f9b41a35 100644 --- a/web/root/ecWeb/lib/captchaLib.ssjs +++ b/web/root/ecWeb/lib/captchaLib.ssjs @@ -16,9 +16,10 @@ function insertCaptcha() { var d = directory(webIni.webRoot + "/lib/captchaAnsis/*"); var randomFont = Math.floor(Math.random() * (d.length)); - var f = directory(d[randomFont] + "*"); + 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 captchaString = ""; - print("<div style=background-color:black;height:100px;float:left;>"); + print("<div style='background-color:black;height:100px;float:left;'>"); for(i = 0; i < webIni.captchaLength; i++) { var randomLetter = Math.floor(Math.random() * (f.length)); var g = new File(f[randomLetter]); @@ -53,4 +54,4 @@ if(http_request.query.hasOwnProperty("font")) { } } closePage(); -} \ No newline at end of file +} -- GitLab