I just love Twitter for changing their API for no particular reason than angering me personally. Usually I just dismiss it until I actually need it again. This time however a customer required it and that meant I had to deal with it.
Drupal has a very neat feature for form validations. The form holds a flat array '#validate' that is simply a list of functions to be executed when validating the form in question. Our example validator for today will be the login form. The array looks like this by default.