Support » Fixing WordPress » Saving links to database adds slashes

  • Hi,
    I’ve developed a plugin with an options form that allows me to save some default data.

    If I type an HTML link into the textarea of the form…
    <a href="" >A Link </a>

    it gets saved in the database as…
    <a href=\"\" >A Link </a>

    Is this something WordPress is doing, or is it a magic quotes thing, or both?

Viewing 2 replies - 1 through 2 (of 2 total)
  • whooami



    thats an example of escaped quotemarks

    ( \ == escaping )

    and quite normal

    is the output what you want? THATS the important thing.

    Laymens Lesson:
    You escape quotemarks like that because you dont and cant have PHP using those particular quotemarks to determine output. In other words, escaping them makes them basically just more text to PHP.

    I see. So it’s coded to do that in wordpress and not because of magic quotes.

    I used stripslashes to fix it while waiting for a reply. I just wasn’t sure if it was the wptexturize thing, or magic quotes or what that was causing it.

    Now I know. 🙂


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Saving links to database adds slashes’ is closed to new replies.