News for hackers. Stuff that matters.
Re:What are the books banned in camp Guantanamo? by sean_patel on Sunday January 15, 2017 @01:30AM (#13402677)
#DeveloperFail

Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books.

I tested it with the following names.

James O'Keefe

Mullah O'Mar

Re:What are the books banned in camp Guantanamo? by Tharre on Sunday January 15, 2017 @04:22AM (#13403196)
Why can't a name simply be a string of length X? All this work of checking for "correct" names is so pointless.
Re:What are the books banned in camp Guantanamo? by throwanem on Sunday January 15, 2017 @07:30AM (#13403713)
Badly written SQL generation often prompts single quotes being forbidden in input. "Having single quotes there breaks my queries," one sometimes hears said. "I don't know why."

This is a great opportunity to mentor one's juniors. An injection attack is trivial to demonstrate in the local dev environment, and the result strongly motivates anyone worth working with to learn how not to do that again.

Re:What are the books banned in camp Guantanamo? by projektfu on Sunday January 15, 2017 @08:11AM (#13403801)
For the 10,000 who might be learning about this today, the answer is prepared statements with placeholders for the values, like this pseudocode:

   stmt = driver.prepare("insert into names 
      (firstname, lastname) values (?, ?)");
   stmt.execute("Flannery", "O'Connor");
Syntax varies among database interfaces but this ensures that any odd strings are properly stored by the driver and the application does not need to worry about them. There is also no risk of someone rewriting the SQL statement.
Re:What are the books banned in camp Guantanamo? by herbst on Sunday January 15, 2017 @04:12AM (#13403167)
Same for äöü. Dev hates foreigners obviously
Re:What are the books banned in camp Guantanamo? by CapacitorSet on Sunday January 15, 2017 @06:23AM (#13403539)
Re:What are the books banned in camp Guantanamo? by jnbiche on Sunday January 15, 2017 @09:02AM (#13403977)
No, getting names right is incredibly simple. It's a single unicode `name` field, stored however your language/db stores unicode. E.g.:

    name: [person's name]
No minimum lengths (other than != 0) and a reasonably large maximum length for your db (only to protect against DoS attacks). Accept all input (into properly prepared SQL statements).
Re:What are the books banned in camp Guantanamo? by CapacitorSet on Monday January 16, 2017 @01:20AM (#13408502)
Reread the list with your assumptions in mind (one nonzero-length field, with a maximum field, Unicode).
Re:What are the books banned in camp Guantanamo? by btschaegg on Sunday January 15, 2017 @05:47AM (#13403432)
Sounds like a very hacky way to avoid little Bobby Tables...
Re:What are the books banned in camp Guantanamo? by Oletros on Sunday January 15, 2017 @08:20AM (#13403829)
But it also forbids characters like ñ or í
Re:What are the books banned in camp Guantanamo? by sean_patel on Sunday January 15, 2017 @02:14PM (#13405754)
Why the downvotes? Sorry for calling it out, but it is indeed a #DeveloperFail. We (developers) have egos bigger than doctors and lawyerys, is that why everyone is downvoting a legitimate assertion with proof? (and more proof in comments to my original comment )