Forums

magic quotes and wordpress. (1 post)

  1. petermcd
    Member
    Posted 4 years ago #

    Hi

    Sorry if this is the wrong place to post this but I couldn't post in the section I believed it belonged in.

    I have just started to delve into creating plugins for wordpress and noticed that if magic_quotes_gpc is disabled then wordpress emulates the functuionality. But also when you enter data into the database you use the $wpdb->escape() method which in turn adds more slashes to the string. So if I enter o'reilly into a form the database is actually receiving o\\\'reilly which means after the database has processed it, it stores o\'reilly causing the need to use stripslashes on the data before working with it.

    Is there a reason for this? Double escaping strings in this way not only wastes resources but also is a very bad practice.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.