11 comments

[ 2.7 ms ] story [ 42.4 ms ] thread
Looks like you've already learned the most important lesson of software engineering: don't reinvent the wheel. Offloading the real work to Google probably is the best way to build this app in most cases, but it makes the headline a little misleading, because you didn't actually write a QR generator, you just wrote a text box that proxies to a web API.
Good effort, but you should go for sanitizing the user input before you go ahead and use it.

For example, if you enter "'/> Hellooooo!" into your textarea, you can see the result shows the text "Helloooo!'/>" being shown next to the QR code for "'/>".

This is hugely important when writing web applications - you can read a bit more from this stack overflow question: http://stackoverflow.com/questions/2794137/sanitizing-user-i...

You may also want to read up about XSS: http://en.wikipedia.org/wiki/Cross-site_scripting

EDIT: I realise this was just a small, simple, learning project, but it's important to learn and be mindful of these considerations.

Thank you very much!
Yet another Google Chart APIs QR code "generator". Come on, seriously, its not so hard to generate it yourself.

(Since there is even a JavaScript library to do it for you there is absolutely no excuse to use Googles API)