Here is one for the strange WPMu bugs division. I had tested the upgrade to WPMu 2.6 for UMW Blogs pretty thoroughly, but there was one small thing I missed. Which manifested itself as an error message, shown below, every time I tried to upload an image or document.
Warning: strpos() [function.strpos]: Empty delimiter in …./public_html/wp-includes/wpmu-functions.php on line 1586
Given that uploading images and documents is not an insignificant feature for UMW Blogs, I was a bit concerned. So, I searched high and low on the forums and elsewhere for a solution, but all to no avail. Finally, I asked the ever great Zach Davis of Cast Iron Coding fame—whose stint with me in grad school has gained him nothing but an endless stream of code questions for over three years now—if this was a problem with the .htaccess file given this fix for the issues with uploading images on WP 2.5. But given it was a PHP error it seemed unlikely, or so Zach informed me 🙂 So, he did me an ace and looked at the code and asked me the following two questions:
Zach: Have you set an option for upload_filetypes?
Me: Yes, jpg jpeg png gif mp3 mov avi wmv midi mid pdf rtf doc xls ppt docx xlsx odt ods swf m4v
Zach: Is there a trailing space or a leading space?
Disco! There was a trailing space in the Upload File Types field in the Site Admin–>Options tab. I got rid of the trailing space and the upload error went away. Now that is code diagnostic prowess, two questions and my problem was fixed, it would have taken me all night and I would have sacrificed those wee hours of blogging bliss too. But, I was spared the knife again thanks to my betters. One day I will learn how to read PHP code, but until then I’ll just have to hail Zach!