Stylizing Modifications Tutorial

By popular request via comments and emails, I have created a page with a detailed tutorial on how to effectively use the Stylizing Modifications textboxes in my widgets. Go ahead and take a read, you might find something that interests you!

htmlspecialchars_decode bug in Wordpress 2.7.1

It has been brought to my attention that there is currently a small bug in Wordpress 2.7.1 that affects certain users of my Status Press Widget and Customizable Search Widget.

This bug mainly affects users of PHP4, because the htmlspecialchars_decode function is not included until PHP5, so Wordpress has now integrated a simulation of the same function in the code core of 2.7.

If you are a PHP4 user running Wordpress 2.7.1, you may get this error from a plugin or widget that attempts to access the htmlspecialchars_decode function:

Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/myname/public_html/personal/wp-includes/compat.php on line 105:

PHP5 users already have this function inherint in their repository, so it just bypasses the Wordpress simulation function.

Apparently when 2.7.1 was released, a slight oversight caused the function to be looking for a variable that was not being passed to it because of a misnaming error.

Details about this error are located in the Wordpress bug tracking system, and it looks like a fix has been submitted for the next version.

However, what should I do until the update? I did some looking into the code that is affected, and noticed that basically in the htmlspecialchars_decode function, Wordpress passes the two expected variables (the string, and the quote style) to its own parser called wp_specialchars_decode. Instead of relying on the PHP version, I have updated my plugins to directly call the Wordpress version of the function to ensure compatibility. Scratch that, that’s not going to work. The wp_specialchars_decode function is only included in Wordpress as of 2.7.1, so it is not backwards compatible and not wise to use.

Instead, you should go ahead and fix the problem with the core file if you are using 2.7.1 and PHP4.

  1. Open up /public_html/<WP Directory>/wp-includes/compat.php
  2. Scroll down to line 104:   if ( !is_scalar( $string ) ) {
  3. Change $string to $str
  4. Do the same thing for the line below it, 105.
  5. Save the file back to your server
  6. Update your plugins.

When you have followed these steps, you should be good to go.  If you do not feel comfortable editing the file yourself, you can just download my edited copy of compat.php:

  compat.php (3.4 KiB, 176 hits)
You need to be a registered user to download this file.

Be sure to upload it to the wp-includes directory. Then update the plugins and widgets that have become broken.

You can find the updates to my widgets here:

If you have any questions or concerns, please do not hesitate to let me know. Oh, and if this has helped you, don’t forget to show a little love:

Status Press 1.12

It was brought to my attention that while updating my plugins to be completely 2.7 compatible, something fell by the wayside (as it normally does). This thing that had fallen was indeed the dear Status Press Widget. Apparently in the 1.11 version of the code, my function to simulate a PHP5 function if the user was using PHP4 had been moved to an incorrect placement inside the widget class. This caused the widget to blow up, even when attempting to activate it. Moving this function outside the class at the very beginning (before the class institiation) corrects the problem and allows both PHP4 and PHP5 users to succefully enjoy this widget.

Please accept my apologies for the previous version mishap.

You can download the latest version on the Status Press Widget page.

Plugin Updates

Tonight I decided to update my Wordpress plugins. So, each of my plugins are now officially compatible with Wordpress 2.7(.1). Please take a look at some of the new features and such of each of them.

  • If you have ever flown on an airplane before, you have probably had the bad luck for the airline company to lose your luggage. However, you have probably never lost your grandmother. Great work US Airways. (0)
SEO Powered by Platinum SEO from Techblissonline