Adventures As Me


Lessons learned

Written 07 Jun 2005

This past weekend working with the “bBlog”:http://www.bblog.com codebase I was reminded of an important principle when it comes to multiple developers on one code base: test your fixes before merging. In trying to fix a problem of spam html sneaking through comment moderation, I changed a regex to a more comprehensive expression. However I used single quotes(‘) rather than double quotes(") to contain the string. Wouldn’t you know, an unescaped string in the regex caused a nasty bug.

The bug was a little strange: "parse error: unexpected $ found at line 1020 in bBlog.class.php" Line 1020 is the last line in the file, the closing ?> tag. The unescaped ‘ was quite a few lines before the end, this led to confusion on the part of all.

The point is, if I had tested before commiting the bug would be isolated only in my code, instead it propagated to everyone. :(

Remember: test, then commit.

Related Posts