The MU forums have moved to WordPress.org

Minor Cosmetic Bug with Apostrophes (8 posts)

  1. fogster
    Member
    Posted 17 years ago #

    Not sure if this is the right place, but I just upgraded to 1.3... One of my blogs has an apostrophe, and it shows up as "Matt\'s Blog."

    I'm imagining that it's a (very minor) bug, unless the way the titles were stored changed. I'm not familiar enough with the WP innards to know where to change it, though. (I imagine it just needs a call to stripslashes() or whatever?)

    Anyone else seeing this problem?

  2. peripatetic
    Member
    Posted 17 years ago #

    I have this as well.

  3. peripatetic
    Member
    Posted 17 years ago #

    I've noticed this is also happening on a Joomla installation I have on the same server. It was suggested in the Joomla forums that this might be due to the magic_quotes_gpc setting in /etc/php.ini (or the php setting override in the .htaccess file in the mu directory).
    I've tried altering these settings (from "off" to "on" in my case), but haven't had any success so far. The only way I've found of removing the backslashes is to go into the database via phpmyadmin and manually remove them -- and of course if there are a lot of them, then this isn't really an option.
    Any ideas?

  4. billnoyes
    Member
    Posted 17 years ago #

    I don't know what causes this issue, but I was able to correct it on existing blogs by editing the database directly. I use phpmyadmin and was able to search for the string that included the \ at the end and remove it. That fixed it for the existing blogs and I haven't had any new blog users register using an ' in the name, so no more issues. Sorry I can't be of more help.

  5. nando99
    Member
    Posted 17 years ago #

    hmm.. I'm having the same problem.. anyone have a permanent fix for this? Manually editing the database every time a new blog is created would be extremely time consuming...

    thanks in advance...

  6. ekusteve
    Member
    Posted 17 years ago #

    I think this is a utf8/unicode issue. I've seen this on a couple different php/mysql programs I use when updating to utf8. Sometimes, it also sometimes results in other characters like queston marks and little white boxes replacing spaces and returns in text.

    I had the \'s problem in some blog titles after upgrading to 1.3 as well. It seems on my install, it only impacted existing blogs, but not newly created ones. My database isn't updated to utf8, so that may be part (or all) of the problem for me. I haven't found a fix for the problem, but I have found at least part of a correction. The blog title is in the "option_value" field of the "Options" table of each blog. The following sql querry will correct it on a single blog, but what I haven't figured out yet is how to change this to make it update multiple tables...if anyone can figure that part out and post back, that would be great...I tried wildcards in pace of the blog number, but no luck.

    UPDATE wp_13_options
    SET option_value = REPLACE (option_value,'/s','s')
    WHERE option_name = "blog_name"

    One other option that was suggested by a programming friend was to do it with php and he suggested the following php script...however, I can't get that to run...still working on it...if I figure it out, I'll post back.

    <?
    $link = mysql_connect('mysql_server', 'mysql_user', 'mysql_password');
    if (!$link) {
       die('Could not connect: ' . mysql_error());
    }
    
    $db_selected = mysql_select_db('mysql_database', $link);
    
    for ($i=0;$i<10;$i++
    {
    $tablename="wp_".$i."_options";
    $sql="UPDATE ".$tablename ." SET option_value = REPLACE (option_value,'/s','s') WHERE option_name = 'blog_name'";
    $result=mysql_query($sql);
    if (!$result)
        echo $sql." Failed";
    
    }
    
    mysql_close($link);
    
    ?>
  7. nando99
    Member
    Posted 17 years ago #

    Thanks for the reply... Would this have to be done manually whenever I want to fix the titles? There really should be a permanent fix for this issue since it seems quite a few people are having the same problem...

  8. ekusteve
    Member
    Posted 17 years ago #

    @nando99

    Based on my experience, if you have your database set-up properly (utf8), then this shouldn't be happening with new blogs. It just seems to have happened, in my case, after I upgraded to 1.3 and my database wasn't utf8. New blogs on my site don't have this problem...even though my database is still not utf8.

    I upgraded to 1.3 about three weeks ago and haven't done another upgrade since, so I'm not sure if this will happen again when I do...I wouldn't expect it to happen if my database was utf8, but since mine is not, I may run into the same issue....I plan to update the code again around the end of the month, so we'll see. Also, I'm not sure if php version has anything to do with or not.

    Steve

About this Topic

  • Started 17 years ago by fogster
  • Latest reply from ekusteve