Jump to content

PEAR db query with quotes, is this safe?


mgob

Recommended Posts

So, I have a application that reads from a DB and needs a field to start with a quote (not escaped) it literally has to have: "values are here" in the field.

 

I am using MDB2 / PEAR for DBI

 

magic_quotes auto adds slashes to the submitted info from the webapp so my question is;

Is the following safe to do to keep just the quotes in the DB without the slashes?

 

$db->quote(stripslashes($content), 'text')

 

this inserts properly with no slashes, my only concern is, is this susceptible to injection attacks or does the MDB2 quote prevent that properly?

 

Thanks!!

Link to comment
https://forums.phpfreaks.com/topic/158055-pear-db-query-with-quotes-is-this-safe/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.