2018-01-03
Fixing stuff in The Virtual Bookcase for PHP 7
After spending an evening fixing scripts on The Virtual Bookcase to make them run in PHP 7 and make them safer at the same time I came to the conclusion that I still don't like php. My conclusion is that if I want to maintain sites I'd rather redo them in perl. I noticed any serious maintenance on the scripts of The Virtual Bookcase was 9 years ago (!). That was also when I had the habit of writing maintenance scripts in perl and web code in php. The upside is that a part of the page-generating code is already available in perl. But a rewrite is a task for another day. For now the site works cleanly in PHP 7 (and 5) and I can go on to the next task for moving the homeserver. Update: Browsing around the development version of the site I came across some very interesting errors (uh oh). It seems some corners of the site were never properly fixed for PHP5, having been touched last in 2006. So I updated those bits and immediately started working on all the cross-site scripting bugs that introduced. I also refactored other bits, since I noticed certain code coming back to me a lot. I still want to move to a different environment that I can support better but the error messages and cross-site scripting needed to go.