Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Strip slashes mysteriously started appearing in links

  1. #1
    It looked easier on TV Array Harold Mansfield's Avatar
    Join Date
    Aug 2008
    Location
    Las Vegas
    Posts
    6,466

    Default Strip slashes mysteriously started appearing in links

    For some reason, whenever I put links in my text widgets and save...it populates strip slashes around the quotes.1
    So this:
    <a href="http://nyblogs.net/activity/"><img src="http://nyblogs.net/files/2010/05/nysample.jpg"></a>
    Turns into this:
    <a href=\\\"http://nyblogs.net/activity/\\\"><img src=\\\"http://nyblogs.net/files/2010/05/nysample.jpg\\\"></a>
    All by itself.

    This just started happening today, and it is not happening on but one of my Wordpress sites.

    I don't know why. I have backtracked any possible reasons, deactivated all plugins and it still persists.

    Does anyone have any idea why this would be happening?
    In 3 years of messing with Wordpress, I have never seen this before.

    In Checking online, I see that they are called "Magic Quotes" but I have no clue why they started showing up all of a sudden.

    Any Clue? Anyone?

    Edited: I knew this day started out too good to be true. I got up early and was going to get a lot done, and then this started and stopped me cold from doing any work at all.

    3 years of using Wordpress and countless installations, customizations and set ups and I have never encountered mysterious characters being automatically added to anything, let alone simple link code.

    I have never seen anything so frustrating. Why would anyone or anything insert any kind of function that would do this to a simple link?
    Why would this just start out of the blue?
    Last edited by Harold Mansfield; 05-23-2010 at 02:57 AM.

  2. Web videos for your business starting at only $109
  3. #2
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,631

    Default

    Are you using a new theme by any chance? The why could be how the theme is handling quotes. If you're using a theme you've used before that wasn't showing the slashes, I'm not really sure why they'd appear.

    You can try a few things. Use single quotes instead of double. My guess is the same thing will be happen, but it's easy enough to try.

    Escape the quotes by adding one slash in front:

    HTML Code:
    <a href=/"http://nyblogs.net/activity//"><img src="/http://nyblogs.net/files/2010/05/nysample.jpg/"></a>
    It could be an issue in your database. You might have set it up with the wrong encoding. Here's how to fix. If it's a brand new installation with no real data you may want to just set up a new database with the encoding set to utf-8.

    I think the issue may be the database one. That was happening to me once and I think that was the issue.
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

  4. #3
    It looked easier on TV Array Harold Mansfield's Avatar
    Join Date
    Aug 2008
    Location
    Las Vegas
    Posts
    6,466

    Default

    Quote Originally Posted by vangogh View Post
    Are you using a new theme by any chance? The why could be how the theme is handling quotes. If you're using a theme you've used before that wasn't showing the slashes, I'm not really sure why they'd appear.

    You can try a few things. Use single quotes instead of double. My guess is the same thing will be happen, but it's easy enough to try.

    Escape the quotes by adding one slash in front:

    HTML Code:
    <a href=/"http://nyblogs.net/activity//"><img src="/http://nyblogs.net/files/2010/05/nysample.jpg/"></a>
    It could be an issue in your database. You might have set it up with the wrong encoding. Here's how to fix. If it's a brand new installation with no real data you may want to just set up a new database with the encoding set to utf-8.

    I think the issue may be the database one. That was happening to me once and I think that was the issue.
    It's only happening on this one installation. I'm using the same theme on another installation and don't have this problem.

    It just started this morning. I have been building this site for 3 days with no problems.

    I am currently on my 3rd call to my host to fix it since I have done everything I can on my end, right down to stripping down everything but the actual installation of MU itself, and it still does it.

    It is UTF-8 by the way.
    I looked at the article and it is about ???'s in content. I don't have that problem, I'm getting \\\'s added to every link, image path or anything with quotes, which is pretty much everything.
    Last edited by Harold Mansfield; 05-23-2010 at 05:16 AM.

  5. #4
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,631

    Default

    It could be your host then. A number of the other problems you've encountered have turned out to be hosting related. It's possible they turned something on or off that they shouldn't have.
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

  6. #5
    It looked easier on TV Array Harold Mansfield's Avatar
    Join Date
    Aug 2008
    Location
    Las Vegas
    Posts
    6,466

    Default

    They swear they haven't changed anything. But I did. I forgot to mention that his all started after I upgraded to the new version of Buddypress and it's been hell ever since.

  7. #6
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,631

    Default

    Hmm? I have a feeling it's something in the way the information is being stored in the database because you're getting 3 slashes instead of one. I think one of those slashes is getting added when the info gets stored and then the 2 other slashes are attempts to escape the slash that was added and the quote.

    One fix you can try is looking in the database for that link in the widget and removing any slashes in there. That won't necessarily solve the problem for the next time you add a link in a widget, but it might fix this one. At the very least you could see if the slashes are being written to the database or if they only appear after reading from the database.
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

  8. #7
    It looked easier on TV Array Harold Mansfield's Avatar
    Join Date
    Aug 2008
    Location
    Las Vegas
    Posts
    6,466

    Default

    I had my host completely disable "Magic Quotes", which by the way, I can't understand how this makes any sense at all and how anyone coded this into databases.
    It makes no sense to have something that ignores what you type, especially with something as common as adding a link or embedding an image...that's 80% of what everyone does.

    Anyway, I'm now only getting one slash and I reverted back to the old version of BP hours ago.

  9. #8
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,631

    Default

    Things like magic quotes are a solution to the problem where a character you enter into the database also happens to be a special character in a programming language. When php sees something like a quote it needs to know it you literally want to display a quote or if it's part of command instructions.

    Magic quotes would automatically escape quotes and other data. It was an old solution that is no longer necessary and it should never have been turned on in the first place. Just curious, but what makes you stick with your current host. A lot of the problems you've mentioned here have usually been because of something your host did or didn't do. Why not find a better host?
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

  10. #9
    Member Needs New Keyboard Array
    Join Date
    Aug 2008
    Posts
    4,487

    Default

    Have you looked at the actual db characters in phpmyadmin to see if they are actually there. The characters could be getting inserted into the database when they are supposed to just tell the db that a " or a few other characters are data, not php characters. It could also be happening when data is being read from the db.

    Is the table type MYISAM? that can create problems as well.

  11. #10
    It looked easier on TV Array Harold Mansfield's Avatar
    Join Date
    Aug 2008
    Location
    Las Vegas
    Posts
    6,466

    Default

    Quote Originally Posted by billbenson View Post
    Have you looked at the actual db characters in phpmyadmin to see if they are actually there. The characters could be getting inserted into the database when they are supposed to just tell the db that a " or a few other characters are data, not php characters. It could also be happening when data is being read from the db.
    I wouldn't even begin to know where to look, which tables should I be checking, or do I check all of them?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •