Problems

Oof. I am having some sort of problem with my server. I was going to make a post on Monday, but something in my PHP and/or MySQL setup has changed in an odd way. (remember I reinstalled/upgraded pretty much everything on the system that is involved with serving web pages a couple of weeks ago)

If I try to post content that contains a single-quote character, I get a database error due to invalid syntax. The WordPress database driver is supposed to auto-escape the content to prevent this, but something seems to be causing that to fail. On the other hand, if I add code to escape the content just before it is saved into the table, then it winds up being double-escaped.

I’m running PHP 4.4.2, and MySQL 5.0.18. PHP reports that magic_quotes_gpc is on, and magic_quotes_runtime is off. I’ve tested on a clean install of WordPress with no plugins activated, and it exhibits the same behavior. Does anybody out there have any ideas on why this is happening?

Stumble It!
Problems

Related posts:

  1. Server problems
    " I’m sure some of you have noticed that I’m experiencing occassional server problems. The host I’m on has been overtaxed, mostly due to spammer..."
  2. del.icio.us daily blog post fixer plugin
    " I mentioned previously that I wanted to make a WordPress plugin that would touch up the posts created by the del.icio.us “daily blog post”..."
  3. Checking Your WordPress Security
    "You may have already heard that sites running out-of-date versions of WordPress have been under attack (Lorelle, Weblog Tools Collection, WordPress Dev Blog). Of course,..."
  4. Using the WordPress Object Cache
    " I’ve been planning to write up a plugin to serve as an example of using the WordPress Object Cache, but haven’t had time to..."
  5. Upgraded
    " I went ahead and took the plunge: this site is now running WordPress 2.0 RC3. Everything seems to be working fine so far, despite..."
This entry was posted in WordPress and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

12 Comments

  1. Fred richtigsaidfred.com
    Posted February 15, 2006 at 1:54 pm | Permalink

    Hi, something just came out today about quote problems (actually an exploit it seems) in WP 2.0:
    http://myimei.com/security/2006-02-15/wordpress200autors-websitexss-attack.html#more-14

    Do you know if WP 2.01 is also vulnerable ? Maybe someone exploited this hole on your blog.

  2. Dougal dougal.gunters.org
    Posted February 15, 2006 at 2:42 pm | Permalink

    I just posted my comments on that. There’s no security problem.

  3. Doug Stewart literalbarrage.org
    Posted February 15, 2006 at 4:47 pm | Permalink

    Do the posts go through, though? I’ve been seeing a lot of admin-side escaping errors since going to 2.x and it’s driving me batty. Highly annoying.

  4. Brendan incoherently.net
    Posted February 15, 2006 at 6:00 pm | Permalink

    Are you using the enhanced html editor or the plain vanilla post editor? The former injects needless mounts of formatting crap – the later doesn’t.

  5. Rudd-O rudd-o.com
    Posted February 16, 2006 at 2:15 am | Permalink

    Turn magic quotes off… All of them.

    And try again.

  6. Dougal dougal.gunters.org
    Posted February 16, 2006 at 10:52 am | Permalink

    Doug: Yes, it appears that the edits are still saved to the db. Wierd, huh?

    Brendan: I don’t use the WYSIWYG editor. And I also remove the wp-texturize filter and code all my HTML by hand. None of which should matter (and yes, I tried without any plugins active). The WP code is supposed to automagically escape the data before doing the SQL INSERTs. I’m sure that this isn’t a fault in WP, though, or many others would be reporting the same problem. This is something messed up in my Apache/PHP/MySQL environment, I’m pretty sure.

    Rudd-O: Good suggestion. But it didn’t work. I also tried turning off the MySQL query cache, but that didn’t fix it, either. The reason I tried that was that actually I was able to resave the draft once without errors, so I thought that it had worked. But then I tried to save the draft a second time, and the errors occurred again.

  7. Dougal dougal.gunters.org
    Posted February 16, 2006 at 5:12 pm | Permalink

    Aha. It turns out that this is a WordPress bug.

  8. rolandog rolandog.com
    Posted February 27, 2006 at 5:04 am | Permalink

    So, then this isn’t why the ol’ JabFoaf (Roster2FOAF) isn’t working?

  9. Carsten subaquasternalrubs.com
    Posted February 27, 2006 at 11:45 pm | Permalink

    I am having the same problem with the email blogging feature. Any time a post is emailed with a single apostrophe, wp-mail chokes and spits out MySQL syntax errors…

  10. Dougal dougal.gunters.org
    Posted February 28, 2006 at 9:35 am | Permalink

    Actually, the JabFOAF stuff has been broken for a while. Every once in a blue moon, I try to figure out what’s wrong, but I haven’t been able to fix it yet. I think there’s some sort of conflict between the Jabber class I was using and something else in my site.

  11. Ben benstillman.com
    Posted March 1, 2006 at 10:38 am | Permalink

    Stupid question: Do you have the runPHP plug-in installed to run PHP scripts from your posts? If so, do you have it turned on for that post? I ran into the exact same problem. Ended up just being that runPHP plugin.

  12. Dougal dougal.gunters.org
    Posted March 1, 2006 at 11:39 am | Permalink

    Ben: not a stupid question at all. I use the PHP Exec plugin. And I’ve suspected that the PHP Jabber libraries just don’t want to work well with PHP Exec for some reason, but haven’t had time to track it down.

    What I need to do is redo the JabFOAF pages as custom template pages.

One Trackback

  1. By geek ramblings » Snow on February 16, 2006 at 5:18 pm

    [...] I originally wrote this up on Monday the 13th, but didn’t get to post it until now because I wound up tracking down a WordPress bug. [...]

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • Subscribe

  • Follow Me

    Twitter  Facebook  Flickr  Last.fm  LinkedIn  StumbleUpon  Technorati  Delicious  
  • Referrals

    Sign up for Text Link Ads and earn money from your blog.
  • Lifestream