Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I disable input filtering?

Here is an example:

echo "\$_GET: ";
var_dump($_GET);

echo "filter.default: ";
var_dump(ini_get('filter.default'));
echo "filter.default_flags: ";
var_dump(ini_get('filter.default_flags'));

echo "\nCurrent PHP version: " . phpversion() . "\n";

When I test it with this url: http://example.org/?text=<a href="http://example.org">...</a> the code generate this:

$_GET: array(1) {
  ["text"]=>
  string(38) "<a href=\"http://example.org\">...</a>"
}
filter.default: string(1) "0"
filter.default_flags: bool(false)

Current PHP version: 5.2.10-2ubuntu6.7

Server info:

System  Linux magentob.builder.hu 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 
This server is protected with the Suhosin Patch 0.9.7
This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0
Loaded Modules:     core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_cgi mod_deflate mod_dir mod_env mod_expires mod_mime mod_negotiation mod_php5 mod_rewrite mod_setenvif mod_ssl mod_status mod_vhost_alias 
share|improve this question

1 Answer 1

up vote 0 down vote accepted

You want to disable magic_quotes which is disabled by default as of php 5.3.0 and removed as of 5.4.0

http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

Edit: guide on disabling http://www.ecommerceoffice.com/enabling-disabling-magic-quotes-in-php/

share|improve this answer
    
thx @dirt, it works –  oliver.nadj Apr 18 '13 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.