Categories
Technology Weblogging

Slash problem in WordPress 1.2

As you may have noticed, I upgraded this site to WordPress 1.2 yesterday. You may have noticed because WordPress 1.2 has what I consider to be a very serious bug in that it ‘escapes’, or adds a slash, in front of all apostrophe’s in both comments and RSS. This is commonly referred to as the ‘magic quote’ problem with PHP. (I’m writing a LAMP essay on this for later.)

The rumors of workarounds at the support center talk about adding filters to filter out the slashes, and I did this for comments. But then, thanks to some friends, I found out that the RSS is also featuring escaped slashes. In fact, the built-in page preview is escaped, and the only thing not escaped is the text in the main post.

 

Since there are new users of WordPress 1.2 that haven’t said anything about this problem, I’m wondering if it has to do with the upgrade from WordPress 1.02 to WordPress 1.2. Or maybe they have a fix. Or maybe they don’t know the problem exists. Or maybe they got the secret decoder ring to wear while writing to their weblog. Mark did you get the secret decoder ring?

I don’t know what’s happened in WP to generate this problem, but you might want to consider postponing a port or upgrade to WordPress 1.2 until an official fix has been created. Having to add these strip slash filters isn’t the best way to deal with this problem.

For those who have ported to WP 1.2 and are having problems, I’ve added filters to the syndication feeds, and the comments that seem to work with the comments at least. We’ll see how it does with syndication.

Add the following to wp-comments.php:

add_filter(’comment_text’, ’stripslashes’);

Make sure to add this into an existing PHP block.

Add the following to the PHP code in the syndication feeds:

add_filter(’the_excerpt_rss’, ’stripslashes’);
add_filter(’the_content’, ’stripslashes’);

Let’s say this post is a good test whether these work or not.

More later on the adventures of upgrading and also what hacks I’ve added.

Update

And when I first posted this, I had an opening PHP block, <?php> …<?> that I didn’t convert to HTML escaped characters included in the code. This caused WordPress to fail. This should not happen–the results might look funny, but the application should not fail.

But the stripslashes seem to be working on new entries within the syndication feeds.

Second update

Let’s do this the easy way: add the following to your .htaccess file:

php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off

This solves the problem without having to add all the filters on new or newly saved entries! The slashes are still in the database for the old entries.

In fact, this probably explains why others do not have this problem–either magic quotes are turned off for their installation, or they have these entries in their .htaccess file. However, it does seem as if the magic quote escaping is happening in the upgrade process. Yes? No?

Or was it that WordPress 1.02 and before handled this ‘badly’, and WP 1.2 handles the situation correctly, but the data is already ucky? I didn’t check the data before I did the upgrade (more fool me).

(Yes, that’s a tech term – ucky. )

More later in a LAMP essay on ‘magic quotes’.

Evil things.

Categories
Photography

Rainy carnival kind of day

Categories
Photography Weather

Moderation in all but storms

I managed to walk right into a major storm, and ended up having to take shelter until it was over. I was soaked, and I could feel the electricity of the storm on my skin, and the drop in pressure in my head.

I had a great time. I also managed to pick up some photos that are not usual for me, and I’ll post later today or tomorrow. My Nikon 995 does quite well in the rain. At least, for now.

Categories
Burningbird

First new look: Burningbird of Happiness

For those with the time and inclination, I’ve modified my third WordPress test weblog to one of the new looks I’m trying.

This one I call The Burningbird of Happiness.

It should validate as XHTML strict and CSS with a little more tweaking on my part. And no tables.

Site also uses several of my hacks turned into plug-ins, and uses the ‘invisible’ WordPress directory structure. In fact, all my tests sites have access to the plug-ins because I’m using the symbolic link to this directory from each weblog.

Whether you’re a techie or not, the Unix symbolic link can be your very good friend.

Categories
Technology Weblogging

I’ll take the dusty apple without the worm

‘You’ll have to excuse me if I seem focused on WordPress right now. This week if I’m not working the back end, adding in all sorts of new plugins and other general tweaking around; I’m working the front, creating several new looks for the Burningbird weblog–each as different from the others as possible.

Currently I’m playing with one look I’m calling “The Burningbird of Happiness”, and frankly having an enormous amount of fun. It’s colorful and very different from this look, and I rather like it. However, I fear that most people, used to the designs fostered by many of the popular weblogging tools, may find it a little, well, shall we say, unpolished? So much so, that I’m thinking of adjusting the titles for each look, just to set the expectations:

The Burningbird of Happiness (who flies outside the CSS Zen Garden)

Li’l Flame – the design guarateed to break TypePad (not the pages, the server)

Ode to Windows Hot Dog Stand (and don’t try this at home, kiddies)

The slightly off-center and irritating Missouri Green

To Ms. Moto: “Eat Pink and Die”

The one-too-many Margarita Look

The god-awful Clash of Colors

There’s something wonderfully liberating accepting the fact that you’re not known for your design acumen. You can, then, freely and happily break every rule of tasteful and elegant design and page layout. As long as the results are easily readable in most browsers on most systems, accessible, and validate, with a minimum of personal anguish to the more artistically sensitive among you, I’ll be happy. If it’s unpolished, at least it’s uniquely me.

Speaking of unpolished, I’ve heard this term used a lot with the WordPress administration pages. I’m not sure why, either. I don’t want to turn this site into a WordPress fandom site, but if WordPress administrative pages are considered ‘unpolished’ what will people think when they get to my pages? Perhaps what the problem is, I don’t understand the difference between ‘polished’ and ‘unpolished’.

I find that the WordPress administrative pages are easy to read and to navigate. They make good use of the space, and they’re clean and uncluttered. They load quickly and simply, and they provide enough space for me to add my tweaks, but not so much space that they’re wasting screen real estate. Frankly, what is so ‘unpolished’ about this?

Is it because the forms and writing isn’t set into miniscule format, and scrunched into a space that would work with the old 640×480 monitors? Is it because the text is black, plain, and easy to read?

Perhaps its the lack of graphics–Wordpress uses a minimum number of graphics. But without all those graphics, the page loads quickly and takes less resources.

In fact, WordPress has all the looks of an application designed to be highly functional and intuitively easy to understand. Aside from one small tweak to the CSS style sheet, to make some borders a tad darker, I find that the tool is very easy on eyes that can be tired at times, or perhaps not as good as they used to be when younger.

It’s odd, but when I first switched from Movable Type to WordPress, I also thought the interface was ‘unpolished’. Now, I’m not sure why, except for the fact that it doesn’t make extensive use of graphics, and the forms tend to fit the page, rather than leaving a great deal of white space.

Maybe that’s the problem: we’ve been looking at sites and styles that are so much alike that when we see something that’s ‘different’ we immediately equate the difference with being less somehow. The more conservative will point out failures in the design and attempt to create a ‘proper’ look; while even the most liberal of us, those who celebrate difference, will mentally ‘polish’ the image in their mind until they see it transformed into something ‘better’; discarding the unique bits along the way.

That’s not to say that a friendly suggestion and helpful hand is amiss–but doing so effectively rather requires one to step into the mind of those who we would help; to respect the essence and the truth of both the design and the designer. Maybe even realize that ‘better’, isn’t always better.