I learned the hard way that Zend_Validate_Hostname really isn't meant to validate URLs. It's mostly to validate just the hostname. Surprisingly, there are no classes in the Zend Validate section which is capable of validating a URL (unless I'm absolutely wrong about this class; if I am, then the class is foobar'd because the regular expression it uses to grab the TLD is wrong if you have a url like http://www.blah.com/blah/1213/13123/sdfsdfsf/sdfsdf). Fortunately, I found a site that had a simple, easy to use URL validator. Unfortunately, because it's not incorporated into the main framework, this situation does imply you having to copy the file each time.
On a side note, one of the unrelated benefits I discovered whilst debugging this issue was a horrible error in my code. So all wasn't lost....maybe even in better because it unveiled a nasty hole in my logic.
Trackbacks: (Trackback URL)