|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45802 Funny behaviour AddHandler
Submitted: 2008-08-12 19:30 UTC Modified: 2008-08-12 22:28 UTC
From: cees at connectcase dot nl Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 5.2CVS-2008-08-12 (CVS) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: cees at connectcase dot nl
New email:
PHP Version: OS:


 [2008-08-12 19:30 UTC] cees at connectcase dot nl
Adding the following to your .htaccess file:

"AddHandler application/x-httpd-php .php"

parses all php files correctly regarding "slash-involved" functions like addslashes, mysql_real_escape_string etc.:

addslashes("O'Brien") results in "O\'Brien" (as it should be?)

Adding the 5 to the PHP handler to your .htaccess file :

"AddHandler application/x-httpd-php5 .htm .html .php"

results in 2 extra slashes.

addslashes("O'Brien") results in "O\\\'Brien".

I have searched for bugreports AND all over the Internet for an explanation (or at least someone who experienced the same). No such luck.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-12 19:42 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

look for magic_quotes_gpc
 [2008-08-12 22:28 UTC] cees at connectcase dot nl

magic quotes are OFF in both cases (no way of changing that: shared hosting). Believe me, I have consulted the manual and the section on magic_quotes_gpc. Could not find any connection with the AddHandler.

In other words, this behaviour is by default and not a bug?
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 01:05:45 2022 UTC