moeffju.net

Plus is valid in e-mail addresses, dammit!

I hate sites that have absolutely broken validation of fields. Whether they require you to enter your credit card number without spaces (because stripping spaces is SO HARD!), expect dates in the brokenest format ever (MM/DD/YYYY, cue the angry Amurricans) without telling you, or disallow special characters in the password(!)… but my favorite would have to be those sites that throw an unfriendly “Your e-mail address is invalid” at you when you enter an address containing a + sign.

Dear site admins, validator programmers, and whatnot: In most cases, I don’t even want to register for your site in the first place, so if you’re going to force me, at least don’t make it harder than necessary! Read the damn RfC! If you block plus signs in e-mail addresses, that means that instead of just using one mailbox and any number of plussed aliased, I have to log in to my server, edit the virtusertable, rebuild it, and reload sendmail.

Unless your page is really valuable for me, chances are that I won’t bother.

Not so ultimate WordPress 2.2 tags

**Update:** I forgot to mention that you must hack a core file and adapt your theme, too. See the end of the article.

Upgrading to WordPress 2.2 bleeding edge is an adventure, always. Not necessarily because they introduce new bugs—it’s the new features that are sometimes worrying. When one svn up changed all the feeds from somewhat-valid RSS to invalid Atom, I didn’t complain because, hey, it’s the bleeding edge, and Atom is so much better anyway. I just fixed the bug, and it was good. (In retrospect, I should have sent a patch. I forgot.)

Having tagging functionality in the WordPress core is a good idea, too. In general. Basically. However, if there already exists a widely-deployed tagging plugin—and for WordPress, one very much does exist—it may be a good idea to look at the functionality and semantics of the existing plugin before reinventing the wheel, badly.

UTW has a function named is_tag(). WordPress 2.2 adds a function of the same name. Ergo, things break. Renaming the plugin dir helps, but your tags are gone. Re-activating the plugin shows you the shiny new plugin sandboxing (which, btw, Habari started in January), but doesn’t bring you back your tags.

Some searching might point you to the UTW tags importer (Options > Import > UTW). After a funny message about deleting unwanted tags from the UTW management page (hey, no plugin, no options page, okay?), the import kinda works. The “Did we say 5 steps? We meant 4. Ha ha ha.” joke is getting pretty old pretty fast, though. Then, instead of the UTW_ShowTagsForCurrentPost() function, you use the_tags() in your template. Of course, the semantics of the_tags() are slightly different from those of the_category(), and completely unlike the old UTW functions semantics.

So I decided to get UTW back. Despite claims to the opposite, the changes required are actually pretty simple: open ultimate-tag-warrior.php and search for occurrences of is_tag(. Replace all occurrences with UTW_is_tag(. Activate the plug-in.

Update: Do the same in your theme - where you use is_tag() now, change it to UTW_is_tag(). Then, open wp-includes/rewrite.php, search for the function get_tag_permastruct, and add return false; directly after the opening brace. (This unbreaks /tag/ pages.)

Done.

Habari development

As you may or may not know, I’m now part of the core development committee of Habari. Habari is a next generation blogging platform written in object-oriented PHP using the model view controller design pattern. There, enough buzzwords?

Not having to support a huge installed codebase with a lot of legacy, we have a chance to “do things right” with Habari. Using MVC is certainly a good start, as is using PDO (now programming SQL injections takes effort). But the nicest codebase still doesn’t make a good product …

… which is why I’m asking you all:

  • What does a blogging platform absolutely need to do for you?
  • What would be really useful features to you?
  • How are you, personally, using your current platform?

Please feel free to write lengthy comments, send me mail, etc.

We are currently aiming for a developers preview release at the end of month, but there’s still a lot of work left to do. If you’re interested, have a look at the mailing lists, or just drop by on IRC, in #Habari on irc.freenode.net.