| Issue 48: | Function used in lightopenid does not exist any more | |
| 1 person starred this issue and may be notified of changes. | Back to list |
In php 5.4beta1 the function get_magic_quotes_gpc() is deprecated and has been removed. As this library uses that function it's not working int php 5.4.
Oct 3, 2011
Project Member
#1
mewp...@gmail.com
Status:
Accepted
Oct 3, 2011
Hi, I have just removed the verification in this line and I use directly the function stripslashes($value), without executing getmagic_quotes_gpc(). I'm not sure about the impact of this change in previous versions, but as far as I know that function is also deprecated in php 5.3
Oct 3, 2011
This isn't a good general solution. For example, a string: $str = 'asd\f'; Without magic quotes: stripslashes($str) == 'asdf' With magic quotes: stripslashes($str) == 'asd\f' Why? Because magic quotes would make the string 'asd\\f' (if it came from GET, or something, of course). So if I wanted to do something like this, I'd just remove the whole block. I'd rather look for a general solution before doing it. Also, magic_quotes are deprecated since php 5.3, but get_magic_quotes_gpc is not, as it has to be used in order to maintain backwards compatibility. At least that's how I understand the php.net docs (it isn't stated anywhere that get_magic_quotes_gpc is deprecated).
Oct 7, 2011
You can use the filter extension (http://php.net/filter) which takes into consideration magic quotes when filtering variables from GET and POST. Instead of: $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET; Do: $this->data = filter_input_array($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, FILTER_UNSAFE_RAW);
Oct 9, 2011
(No comment was entered for this change.)
Status:
Fixed
|