Questions tagged [magic-quotes]

A security process that automatically escapes incoming data to the PHP script.

A security process that automatically escapes incoming data to the PHP script. In summary, all ' (single-quote), " (double quote), \ (backslash) and NULL characters are escaped with a backslash automatically.

This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

60 questions
3
votes
4 answers

which one will be better to use default magic quotes or user defined addslash/stripslash in PHP?

which one will be better to use default magic quotes or user defined addslash/stripslash in PHP? I want use the best one. please help me.
Sadat
  • 3,493
  • 2
  • 30
  • 45
3
votes
6 answers

why can't php just convert quotes to html entities for mysql?

PHP uses "magic quotes" by default but has gotten a lot of flak for it. I understand it will disable it in next major version of PHP. While the arguments against it makes sense, what I don't get it is why not just use the HTML entities to represent…
netrox
  • 5,224
  • 14
  • 46
  • 60
2
votes
1 answer

Is it possible to make a portable password storing PHP code when magic_quotes_qpc is on?

I am developing my first website. My shared hosting provider has magic_quotes_qpc on and doesn't want to change it. As I understand, there is a following problem with password storing: 1. User types in a value like "strong'password" into a…
Kadilov
  • 145
  • 1
  • 6
2
votes
1 answer

Plus sign disappearing on server side?

I can't look at mysql tables right now...but I don't think '+' is making it into the table. I checked magic_guotes and it is turned on. However magic_quotes should not do anything to the '+' sign as it only relates to escaping for characters the…
user656925
2
votes
2 answers

convert JSON object to query string and then back to an object

I know this has been asked a few times but please bear with me. I have a google maps object which is rather complex (it contains various nodes, coordinates, etc) and I am trying to pass it as a query string. I need a play javascript/jQuery…
Nick
  • 2,877
  • 2
  • 33
  • 62
2
votes
3 answers

print_r() and mail() in PHP outputs something different, why?

I have a html form where visitors can fill and send me some information, as an e-mail. It sends like this: $body = print_r($_POST, true); mail ($to, $subject, $body, $headers); When they write abc'def I get abc\'def What is this additional \? How…
ilhan
  • 8,700
  • 35
  • 117
  • 201
2
votes
1 answer

Fixing magic_quote affected data

I've got a CMS to fix some issues. Since the hosting service has enabled php_magic_quotes in the server their database contains content with slashes. Once I got the project I requested the hosting party to switch off the magic_quotes and the issues…
Prasad Rajapaksha
  • 6,118
  • 10
  • 36
  • 52
1
vote
3 answers

magic_quotes off - can code break?

If I turn off magic_quotes in an environment where I did not wrote the code, how can I check if any problems may occur? For what do I have to check? Which functions may not work any more?
shredding
  • 5,374
  • 3
  • 46
  • 77
1
vote
0 answers

Script to undo php Magic Quotes and mysql_real_escape_string combination

For the last 4 years I've run a site mistakenly using both magic quotes and mysql_real_escape_string simultaneously. This has resulted in all manner of different format strings being stored where in most cases quotes are doubly escaped and thus…
Dan
  • 11,914
  • 14
  • 49
  • 112
1
vote
1 answer

After moving TinyMCEditor around

I moved ModX to a new location. Inside ModX there is a TinyMCEditor. After the move, if I paste html into it, TinyMCEditor is replacing all my content with strange words and backslashes. Old content which worked in old TinyMCEditor :
Trip
  • 26,756
  • 46
  • 158
  • 277
1
vote
2 answers

Using get_magic_quotes_gpc on PHP Version 5.2.14 or equivalent for PHP Version 6

Our site is using PHP Version 5.2.14 Lately our hoster probably changed magic-quote defenition, and I came up with the suggested solution [code bellow] Is this solution OK for PHP Version 5.2.14 ? What should I change when we upgrade to PHP version…
Atara
  • 3,523
  • 6
  • 37
  • 56
1
vote
2 answers

php special characters problem

I am having a problem with the special characters in my script: This is what I have so far: $curlstrip = explode("&", $data); $filename = substr(htmlEntities($curlstrip[5]), 2); and if $data contains any special charaters like ' which is ',…
Chris19
  • 210
  • 7
  • 17
1
vote
1 answer

Wordpress shortcode, backslash added in front of double quotation marks

I need to add some html to shortcode image tag for example 5 star rating When I check value in database, I can see all double quotation marks formatted with backslashes
zhoradk
  • 43
  • 8
1
vote
1 answer

add_magic_quotes() is not working in wordpress

Here is the code that's run by the plugin. It passes the CSV file data to MySQL.: $new_post = array( 'post_title' => $row['Account Name'], 'post_content' => $row['Yellow Page Business Description'], 'post_status' …
Haris Khan
  • 13
  • 3
1
vote
4 answers

Does using magic_quotes() affect the use of mysql_real_escape_string()

If I have magic_quotes switched on and I use mysql_real_escape_string, will the string be double escaped? Will it cause problems? I assume so based on the get_magic_quotes() function but just seeking confirmation. (P.S. It's easier to ask this…
sjw
  • 2,603
  • 5
  • 22
  • 20