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
0
votes
3 answers

Having trouble with escape quotes, php

I have a for loop that runs through a set of questions with a text area next to each question. But if the question or answer has an apostrophe in it (as if someone asked "Don't" or "Can't" in the question), it doesn't get inserted into the…
Java00011111
  • 7
  • 1
  • 5
0
votes
3 answers

Is it possible to turn off magic quotes without an .htaccess or a php.ini file?

One of my clients is hosting their site on freeservers.com ( a host that should be avoided at all costs ). The host does not allow .htaccess files, and has no editable php.ini file on the server to edit. But it does have magic_quotes on. Which is…
Trip
  • 26,756
  • 46
  • 158
  • 277
0
votes
1 answer

Wordpress escaping quoting ONLY when inserting into the database

here's another problem: I have built a custom plugin... all works except when I update a record everything gets escaped and magic quoted. I have stripslahsed_deep the $_POST and the rest, however it seems I can see the query ACTUALLY going in by a…
johnbell
  • 7
  • 2
0
votes
0 answers

Is it necessary to disable 'MAGIC QUOTES' at runtime in PHP 8.2.0

Is it necessary to disable 'MAGIC QUOTES' at runtime in PHP 8.2.0, when all the 'MAGIC QUOTES' functions are already removed from PHP 8.2.0 ? All of the other questions are old and about how to disable magic_quotes_runtime. Any help is appreciated.
Codestrip
  • 27
  • 10
0
votes
1 answer

Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_runtime()

On my website, I have a Coppermine photoalbum integrated. It worked fine, but I think the error occured after php 8.0 was activated. Heres the link to the photogallery of the site: https://www.toneelgroepcontactharlingen.nl/cpg16x/ Heres the…
0
votes
1 answer

SQL Injection when magic quote is enabled

Possible Duplicates: Are single quotes escaped automatically in PHP? Then what's the need for cleaning? Successful SQL Injection despite PHP Magic Quotes Earlier today I asked about automatic escaping of quotes and learned about magic quotes. The…
Erik
  • 2,276
  • 1
  • 20
  • 20
0
votes
2 answers

MySQL PHPMyAdmin Localhost to accept Magic Quotes

I'm having a small problem with my localhost on Ubuntu to accept data posted with apostrophes from a PHP file into the MySQL database. Example: It's your birthday! Will not be accepted by my localhost database and it won't accept anything coming…
yanike
  • 827
  • 3
  • 13
  • 29
0
votes
0 answers

Fatal error related to magic_quotes in PHP

So I'm trying to figure out a website error for my friend. Unfortunately, I'm not that good at PHP and unfortunately his website is...ancient. I tried referring to other questions here, but as my code example looks a tad different, I'm worried about…
Benjamin
  • 1
  • 1
  • 1
0
votes
2 answers

Is there any value in PHP checking a bool vs an int?

I have the following line: $this->magicQuotes = (bool) get_magic_quotes_gpc(); I am taking the get_magic_quotes_gpc() storing it in my object as it's used many times as I generate the SQL. I am also converting it to a bool. I'm wondering if it's…
Darryl Hein
  • 142,451
  • 95
  • 218
  • 261
0
votes
2 answers

PHP file() adding slashes to single quotes

I have a PHP installation running 5.3.3 and when I use the code below: $sql = file('sql.txt'); var_dump($sql); All my single quotes are escaped. Why would this be happening. Magic quotes is enabled on the server (for some reason, it is…
Luke
  • 6,195
  • 11
  • 57
  • 85
0
votes
0 answers

Why is my form inserting backslashes before quotes?

My php code to edit a text document is adding a backslash anywhere a ' or a " is used and I can't figure out why. Anybody ever ran into this before? How did you fix it?
0
votes
1 answer

PHP - HTML input string is stored as escape-sequence string in MySQL

I have basic Website using HTML, PHP, MySQL. HTML input: C# - Developer's Guide "LIMITED EDITION" becomes In PHP : C# - Developer\'s Guide \"LIMITED EDITION\" In MySQL: C# - Developer\'s Guide \"LIMITED EDITION\" In PHP I…
Naveen Kumar V
  • 2,559
  • 2
  • 29
  • 43
0
votes
0 answers

Call to undefined function set_magic_quotes_runtime() in core php

I am facing these problem.I am using PHP 7. other project rather than core PHP runs very good but if I want to run the core PHP project it shows the following problem. Uncaught Error: Call to undefined function set_magic_quotes_runtime() in…
sabin maharjan
  • 107
  • 1
  • 11
0
votes
0 answers

Magic Quotes in 5.5

According to documentation i should not have magic quotes, but i do. I am building a website with the slim framework. I am trying to make a xml creator for my rss feed and the api call looks like this: function createRSS($dbh, $args) { $xml =…
user2455869
  • 151
  • 1
  • 13
0
votes
3 answers

Using single 'smart quote' in my JSON data is breaking PHP script

I've got a PHP script that is reading in some JSON data provided by a client. The JSON data provided had a single 'smart quote' in it. Example: { "title" : "Lorem Ipsum’s Dolar" } In my script I'm using a small function to get the json…
Jeff
  • 4,136
  • 23
  • 32