Comments (7)
wow. finally a real bug report and a patch (vs. the crap other people submit).
you rock. =)
i'll get that fixed in svn as soon as i have a chance.
Original comment by [email protected]
on 9 Feb 2009 at 9:52
- Changed state: Accepted
from kaptcha.
Hey, thanks for answering so fast. I think it is a nice feature, keep up the
good
work :-)
Original comment by [email protected]
on 10 Feb 2009 at 9:15
from kaptcha.
Original comment by [email protected]
on 17 Feb 2009 at 12:57
- Added labels: Milestone-2.3.1
from kaptcha.
Original comment by [email protected]
on 16 Nov 2010 at 8:33
from kaptcha.
This issue was closed by revision r117.
Original comment by [email protected]
on 20 Nov 2010 at 7:28
- Changed state: Fixed
from kaptcha.
What steps will reproduce the problem?
1. Get kaptcha up and running
2. Configure a simple textproducer char string for the DefaultTextCreator,
i.e. use the following parameters:
kaptcha.textproducer.char.string="abcefghijklmnopqrstuvwxyz"
kaptcha.textproducer.char.length=5
What is the expected output? What do you see instead?
Captcha image containing a random sequence of the configured characters.
Instead, only first 5 characters appear. This is due to previous bug fix on
version 2.3
What version of the product are you using? On what operating system?
kaptcha-2.3.1.jar on Windows XP (will happen on any environment as the
error is in the source code, see below)
Please provide any additional information below.
Take a look at the getText method:
int length = getConfig().getTextProducerCharLength();
char[] chars = getConfig().getTextProducerCharString();
Random rand = new Random();
StringBuffer text = new StringBuffer();
for (int i = 0; i < length; i++)
{
text.append(chars[rand.nextInt(length)]);
}
return text.toString();
This will only produce the first "length" (5) characters.
The correct version is to change line 25 adding "chars.length" instead of
"length":
int length = getConfig().getTextProducerCharLength();
char[] chars = getConfig().getTextProducerCharString();
Random rand = new Random();
StringBuffer text = new StringBuffer();
for (int i = 0; i < length; i++)
{
text.append(chars[rand.nextInt(chars.length)]);
}
return text.toString();
Attached is a patch to fix this. It simply changes line 25.
Original comment by [email protected]
on 25 Nov 2010 at 1:05
Attachments:
from kaptcha.
ok, i've committed this fix.
Original comment by [email protected]
on 5 Dec 2010 at 11:37
- Added labels: Milestone-2.3.2
from kaptcha.
Related Issues (20)
- Remove pixels-jar from distribution HOT 1
- Enhancement for Wiki documentation HOT 1
- image with wrong code HOT 8
- session key is previous image - don't think it is KAPTCHA; looking for direction HOT 1
- Problem with Can't read the image? Click it to get a new one HOT 3
- Issues with the test environment HOT 1
- Can't Re-genarate image HOT 1
- java.lang.NoSuchMethodError: com.jhlabs.image.RippleFilter.setXAmplitude HOT 1
- unhandled exception leads to java heap dump (Compiled_method=com/jhlabs/image/TransformFilter.filter(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage;) HOT 1
- The package is not available from any of the existing maven repositories HOT 1
- java.lang.IllegalStateException: getWriter() has already been called for this response HOT 1
- Maven repo HOT 2
- wrong captcha after IE9 sends 2 requests and cuts one off HOT 9
- Kaptcha is not validated in Safari Browser
- the kaptcha image's font border can not be customrized. HOT 3
- It does not work well in Firefox 23.0.1 HOT 12
- config no working when use @WebServlet annotation HOT 6
- Kaptcha is not validated in Google Chrome browser HOT 1
- The image is not showing after uploading the application on amazon ec2 instance HOT 1
- Java Compatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kaptcha.