PHP-CGI: drupal adds slashes to special characters
mmickey - June 26, 2009 - 15:52
Hi,
I have a running drupal site which I built in a sandbox on my linux system. Everything worked well there, then I uploaded to all-inkl.com and made it work there. One thing is left and I don't know the reason.
When I post another article/blog/page on the site on the web, drupal replaces special caracters like ',",\ with \', \",\\ everytime I save it. It does that even iteratively, so ' becomes \', becomes \\\' and so on... It didn't do that on the sandbox system, and I have no clue why. I tried it with and without FCKeditor, no difference...
Any ideas?
greets mike

Complain to your host
http://us3.php.net/magic_quotes
Thank you for your reply. Do
Thank you for your reply.
Do I need them to be enalbed or disabled?
I experimented with them on my local installation with
php_flag magic_quotes_gpc on/off
php_value ... on/off
burt I couldn't reproduce the behaviour with the slashes on my local installation...
greets mike
You want them off. Any host
You want them off. Any host who enables them by default should be shot.
A trick: use
phpinfo()to find out all kinds of interesting stuff about your installation.Hi, thanks again for your
Hi,
thanks again for your help. I had a look at phpinfo and it tells me, that magic quotes are off (at least locally, but that should be enough if I get it right), but the problem persists, ' is replaced with \' and so on...
any further ideas?
greets mike
ok, I have retried on my
ok, I have retried on my local installation, both with magic quotes on and off (validated now with phpinfo that it is really on or off), and I cannot reproduce on my local installation... the problem persists with the copy on the server of my webhoster, where magic quotes is off.
so I guess there should be another reason, but what???
greets mike
Anyone? greets mike
Anyone?
greets mike
php-cgi problem
so after some further testing, it seems the problem is php-cgi related.
I need to enable php-cgi on my server because otherwise proc_open is disabled, and when enabling php-cgi the replacement of the slashes starts...
magic quotes are off also for the php-cgi version.
Any ideas what could cause the problem with php-cgi?
here is phpinfo output:
allow_call_time_pass_reference On On
allow_url_fopen On On
allow_url_include On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl Off Off
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 6135 6135
expose_php On On
extension_dir /usr/lib/php5/20060613 /usr/lib/php5/20060613
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/share/php:.. .:/usr/share/php:..
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc Off On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value no value
mail_extra_headers On On
max_execution_time 30 30
max_input_nesting_level 64 64
max_input_time 60 60
memory_limit 64M 64M
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 200M 200M
precision 12 12
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv On On
register_globals Off Off
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
suhosin.log.phpscript 0 0
suhosin.log.phpscript.is_safe Off Off
suhosin.log.phpscript.name no value no value
suhosin.log.sapi no value no value
suhosin.log.script no value no value
suhosin.log.script.name no value no value
suhosin.log.syslog no value no value
suhosin.log.syslog.facility no value no value
suhosin.log.syslog.priority no value no value
suhosin.log.use-x-forwarded-for Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 200M 200M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off
please help,
greets mike