• Shinhan (unregistered)

    They are discriminating against people older than 99. I mean, babies are allowed, but old people are not? :(

  • (cs)

    Notice that the ZIP function will succeed without checking the input if a hidden field on the form is set to "sverige" (Sweden), ignoring case.

    Because, you know, Sweden is the only country that doesn't use a ZIP code.

  • jonny s. (unregistered) in reply to Someone You Know

    clearly, the swedish do not make mistakes when filling out online forms.

    also: chocolate.

  • b.p. (unregistered)

    But what if your 100+ years old and want to join?

  • Patrik (unregistered) in reply to Someone You Know
    Someone You Know:
    Notice that the ZIP function will succeed without checking the input if a hidden field on the form is set to "sverige" (Sweden), ignoring case.

    Because, you know, Sweden is the only country that doesn't use a ZIP code.

    No, the other way round. They only validate Swedish ZIP codes, which actually makes sense.

    The real WTF however is that they use regular expressions /1/../9/ instead of one /[1-9]/.

  • (cs) in reply to b.p.
    b.p.:
    But what if your 100+ years old and want to join?
    "I would never want to belong to any group that would have someone like me for a member!" --Woody Allen
  • (cs)

    If all you have is a hammer, everything looks like a nail.

    If all you have is scientology, all of your input looks like body thetans, and it needs to be purged.

  • Tim (unregistered)

    No wonder so many websites will allow 000-000-0000 as a valid phone number.

  • Ed (unregistered) in reply to ParkinT

    I think that was Groucho

  • KT (unregistered)

    TRWTF is the





















































































































    starting from line 456.

  • JD (unregistered)

    When would s.substr(1,1) > "9" ever be true?

  • E (unregistered)

    Couldn't they have at least taken all the replacement code out into another function if they were going to use it so much?

  • Shinhan (unregistered) in reply to Patrik
    Patrik:
    Someone You Know:
    Notice that the ZIP function will succeed without checking the input if a hidden field on the form is set to "sverige" (Sweden), ignoring case.

    Because, you know, Sweden is the only country that doesn't use a ZIP code.

    No, the other way round. They only validate Swedish ZIP codes, which actually makes sense.

    The real WTF however is that they use regular expressions /1/../9/ instead of one /[1-9]/.

    No, they wanted /^[0-9]{5}$/ /[1-9]/ makes sense only if 9999999 is a valid Zip Code.

  • (cs) in reply to b.p.
    b.p.:
    But what if your 100+ years old and want to join?

    Maybe they don't want a bunch of old people in their scientologist group. They wouldn't be missing anything.

  • John Doe (unregistered) in reply to Shinhan

    Nope, babies, and kids under 10 are not allowed either. Two digits are required, but when age starts with a "0", it gets discarded as well.

  • A (unregistered)

    Well damn. I filled out the whole ridiculously long 200 question questionnaire, and of course I didn't get anything for it, but they will call my number to tell me the results. The WTF is: only land lines, no cell phones.

    Not that I gave any of my info of course, and if they send any emails, I hope [email protected] will be happy :D

  • (cs) in reply to JD
    JD:
    When would s.substr(1,1) > "9" ever be true?
    For any character of charcode greater than 58.

    So any character of this list:

    :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
    Shinhan:
    Patrik:
    Someone You Know:
    Notice that the ZIP function will succeed without checking the input if a hidden field on the form is set to "sverige" (Sweden), ignoring case.

    Because, you know, Sweden is the only country that doesn't use a ZIP code.

    No, the other way round. They only validate Swedish ZIP codes, which actually makes sense.

    The real WTF however is that they use regular expressions /1/../9/ instead of one /[1-9]/.

    No, they wanted /^[0-9]{5}$/ /[1-9]/ makes sense only if 9999999 is a valid Zip Code.

    Also known as

    /^\d{5}$/
  • (cs)

    You have to pay for more training in order to be enlightened and fully understand the hidden obfuscated powers of what seems to be silly javascript but is not.

    And thetans.

  • (cs)

    The Real WTF is Scientology

  • (cs) in reply to masklinn
    masklinn:
    Also known as
    /^\d{5}$/

    As always, the boggling part is: if they know how to match using /\d/, then why don't they know how to match using /^\d{5}$/ ?

  • codemonkey (unregistered) in reply to Someone You Know
    Entry:
    if(trim(document.getElementById("M_land").value.toLowerCase()) != "sverige") { return(true); }
    Someone You Know:
    Notice that the ZIP function will succeed without checking the input if a hidden field on the form is set to "sverige" (Sweden), ignoring case.

    Because, you know, Sweden is the only country that doesn't use a ZIP code.

    Actually, it says val != "sverige" return true. Thus if the person is from Sweden, they require checking, otherwise they know what they're doing.

    Entry:
    if(s.substr(1,1) < "1" || s.substr(1,1) > "9") return(false);
    Also, last time I checked, substr(1,1) returned "".
  • KT (unregistered) in reply to savar
    savar:
    masklinn:
    Also known as
    /^\d{5}$/

    As always, the boggling part is: if they know how to match using /\d/, then why don't they know how to match using /^\d{5}$/ ?

    At least they know \w.

    /^\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/ (line 400)

  • JD (unregistered) in reply to masklinn
    masklinn:
    JD:
    When would s.substr(1,1) > "9" ever be true?
    For any character of charcode greater than 58.

    So any character of this list:

    :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~

    K, then since all they really seem to care about is whether a string of characters are numbers, can't they just loop through each string to see if each substring is between "1" and "9"? I mean, they do this anyway...

  • Tim (unregistered) in reply to Volmarias

    Are non-zero numbers the equivalent of thetans? Maybe that's why these algorithms remove them. Just my 0 cents (thetans purged).

  • (cs) in reply to Dunkelschub
    Dunkelschub:
    The Real WTF is Scientology
    You beat me to it!

    Seriously though, does anyone else have the feeling that they are all laughing at us. Tom Cruise and John Travolta are sitting at dinner saying things like "I can't believe people are joining us!", "We can make people do ANYTHING because we are celebrities!" and "This is more fun than taking stands on politics!".

    It really must be an elaborate joke. No one can really believe such things...

    right?

  • Alcari (unregistered) in reply to JD
    JD:
    K, then since all they really seem to care about is whether a string of characters are numbers, can't they just loop through each string to see if each substring is between "1" and "9"? I mean, they do this anyway...
    Of course not. you can't just ADD something to this. It would destroy the artistic beauty of the the whole code.

    shees.

  • zoips (unregistered) in reply to codemonkey
    codemonkey:
    Entry:
    if(s.substr(1,1) < "1" || s.substr(1,1) > "9") return(false);
    Also, last time I checked, substr(1,1) returned "".

    String.substr(index : Number, length : Number) : String

    So no, substr(1, 1) returns a single character at index 1.

  • sheya (unregistered)

    haha must be one of the greediest companies still in existance :)

    they dont have enough money to hire someone who UNDERSTANDS what they do

  • Aaron (unregistered)

    The real WTF is that their checking won't allow anyone to be older than 99...

  • Bobble (unregistered)

    It is not surprising that a Scientology site doesn't allow people younger than 10 or older than 99.

    These groups must have been ruled out as revenue sources.

  • similis (unregistered)

    Regexes are actually a conspiracy of the evil software conglomerates.

  • Tom Cruizer (unregistered) in reply to Volmarias

    teh rofl

  • Anonymous (unregistered) in reply to Volmarias

    Volmarias, you made me lol. Good show.

  • (cs) in reply to DeLos
    DeLos:
    Dunkelschub:
    The Real WTF is Scientology
    You beat me to it!

    Seriously though, does anyone else have the feeling that they are all laughing at us. Tom Cruise and John Travolta are sitting at dinner saying things like "I can't believe people are joining us!", "We can make people do ANYTHING because we are celebrities!" and "This is more fun than taking stands on politics!".

    It really must be an elaborate joke. No one can really believe such things...

    right?

    I have a theory about celebrities in Scientology. Whether they believe the myths of Scientology or not, their practice of "auditing" has the effect of training you to keep your cool when being harassed. That's an especially valuable skill for those constantly in the spotlight.

  • (cs) in reply to Minos
    Minos:
    DeLos:
    Dunkelschub:
    The Real WTF is Scientology
    You beat me to it!

    Seriously though, does anyone else have the feeling that they are all laughing at us. Tom Cruise and John Travolta are sitting at dinner saying things like "I can't believe people are joining us!", "We can make people do ANYTHING because we are celebrities!" and "This is more fun than taking stands on politics!".

    It really must be an elaborate joke. No one can really believe such things...

    right?

    I have a theory about celebrities in Scientology. Whether they believe the myths of Scientology or not, their practice of "auditing" has the effect of training you to keep your cool when being harassed. That's an especially valuable skill for those constantly in the spotlight.

    So instead of meditating they believe in aliens stuffing volcanoes?

  • jeff (unregistered)

    awesome? no. ingenious? maybe. amateur? definitely.

    all this nonsense: s = s.replace(/1/g,"0"); s = s.replace(/2/g,"0"); s = s.replace(/3/g,"0"); s = s.replace(/4/g,"0"); s = s.replace(/5/g,"0"); s = s.replace(/6/g,"0"); s = s.replace(/7/g,"0"); s = s.replace(/8/g,"0"); s = s.replace(/9/g,"0");

    can be replaced with: s = s.replace(/\d/g,"0");

    not that i'd do it that way in the first place... i guess the thetans made them do it.

  • psini (unregistered) in reply to ParkinT
    ParkinT:
    b.p.:
    But what if your 100+ years old and want to join?
    "I would never want to belong to any group that would have someone like me for a member!" --Woody Allen

    er... I think it was a quote from Groucho Marx.

  • Anomynous (unregistered) in reply to Shinhan
    Shinhan:
    They are discriminating against people older than 99. I mean, babies are allowed, but old people are not? :(

    In all seriousness, no, the Scientology organization is not interested in old people. They tend to discard the old and sick members once they are no longer of use to Scientology, and they focus on recruiting the young and rich.

  • Ron (unregistered)

    Ok. If I ever saw ANYONE writing code at my company like this, I would fire them immediately.

    Even if I wasn't their boss and I technically couldn't fire them, I would still fire them.

  • aaron (unregistered) in reply to pitchingchris

    only l.ron hubbard is allowed to be 100 yrs old or greater

  • Bing (unregistered) in reply to Volmarias

    Oh my, they have good code! They must be evil!!!

    Stop the anti-religion bullshit. Our time would be better spent on things that matter (like the wars, the economy, the election), rather than sensationalist bigotry crap.

  • (cs) in reply to Bing
    Bing:
    Stop the anti-religion b***s***. Our time would be better spent on things that matter (like the wars, the economy, the election), rather than sensationalist bigotry crap.

    It may be anti-religion BS, but it's not bigotry. People can't choose to be white, black, female, asian, or eskimo. So making fun of that is bigotry. People can choose what they believe (well, there are unfortunately exceptions in many places). If you have the freedom to believe, and you believe something stupid, you shouldn't be immune from reasoned ridicule.

  • Imaginary Property (unregistered)

    You should be careful with that code. It's probably copyrighted, patented and trademarked Religious Technology.

    They don't trust "wog" technology made by non-Scientologists, so they have to do everything their own... unique ... way. I'm just waiting for them to send some kind of infringement notice and threaten to sue the site for 'injuring their reputation of being non-litigious' or something.

    If possible, I suggest giving them Mandatory Fun Day as a compromise rather than going to court. It's the sort of thing a Scientologist might enjoy.

  • Gus (unregistered)

    I guess people living past 99 breaks some kind of Hubbard law.

  • immibis (unregistered)

    Where the hell is 'sverige'?

  • (cs) in reply to Flash
    Flash:
    Bing:
    Stop the anti-religion b***s***. Our time would be better spent on things that matter (like the wars, the economy, the election), rather than sensationalist bigotry crap.

    It may be anti-religion BS, but it's not bigotry. People can't choose to be white, black, female, asian, or eskimo. So making fun of that is bigotry. People can choose what they believe (well, there are unfortunately exceptions in many places). If you have the freedom to believe, and you believe something stupid, you shouldn't be immune from reasoned ridicule.

    I'm offended you referred to scientology as being a religion. It's an insult to religion.

  • notme (unregistered) in reply to DeLos
    DeLos:
    Dunkelschub:
    The Real WTF is Scientology
    You beat me to it!

    Seriously though, does anyone else have the feeling that they are all laughing at us. Tom Cruise and John Travolta are sitting at dinner saying things like "I can't believe people are joining us!", "We can make people do ANYTHING because we are celebrities!" and "This is more fun than taking stands on politics!".

    It really must be an elaborate joke. No one can really believe such things...

    right?

    Well, seen from an objective distance, many other world religions are not much less ridiculous than this one...

  • Anonymous (bahaha) (unregistered)

    Proper input validation closed due to thetans. TRWTF is that anyone is surprised by this... after their sites got hacked, I mean DDOS'd, by teenage punks (before a more legal protest movement stepped in and replaced DoS'ing and blackfaxing), they called in consultants by the droves. Hearsay was that their systems were five years behind on security and defense (i.e. malware).

    I guess before they pissed off the younger contingent of the Internet (i.e. 4chan) with that whole "yank the 'Tom Cruise laughs like a crazed slave and babbles' video" stunt, they just had old-timers picketing outside their buildings and talking smack about them on alt.religion.scientology.

  • Zing (unregistered) in reply to Bing
    Bing:
    Stop the anti-religion bullshit.
    Christianity: $0. Islam: $0. Judaism: $0. Hinduism: $0. Buddhism: $0.

    Scientology: $325,000.

  • SEMI-HYBRID code (unregistered) in reply to Volmarias

    someone reads Raymond Chen's blog in here? =) anyway, i like the method... it's similar to what i would do if i were too lazy to look for VB's IsNumeric function equivalent in JavaScript. (and to be honest, i really don't know the funcion name in JS O:-))

Leave a comment on “N-Replace Zero-Test”

Log In or post as a guest

Replying to comment #:

« Return to Article