Edit report at https://bugs.php.net/bug.php?id=61148&edit=1
ID: 61148
User updated by: khaos337 at gmail dot com
Reported by: khaos337 at gmail dot com
Summary: auto_prepend_file and auto_append_file seemingly
load on favicon request
Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: FreeBSD7.3 (amd64)
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
redirect is done through htaccess
ErrorDocument 404 /error404/
Previous Comments:
------------------------------------------------------------------------
[2012-02-20 20:44:18] [email protected]
Because that wan't the requested uri? Depends on how you are doing the 404
redirect, I guess.
------------------------------------------------------------------------
[2012-02-20 20:39:08] khaos337 at gmail dot com
Understood, just one more quick question though. If the 404 page is the one
causing the file to fire again, which would make sense because it is a php
page,
why wouldn't the $_SERVER['REQUEST_URI'] kick back the 404 page
'/error404.php/'
instead of '/favicon.ico/'?
------------------------------------------------------------------------
[2012-02-20 20:34:36] [email protected]
A favicon request is a request like any other. If the favicon.ico file doesn't
exist the request will trigger a 404 and your 404 handler will be run. The same
will happen if your main request tries to load images/css/js that don't exist,
so
you either need to make sure your main requests never generate a 404 or you
need
to make your 404 handler/prepend script smarter. You can have it check the
requested URI and skip doing whatever it is you don't want it doing multiple
times per page load. This isn't something we can fix at the PHP level. PHP is
doing what you are asking it to do here.
------------------------------------------------------------------------
[2012-02-20 20:30:49] khaos337 at gmail dot com
I do have a 404 handler pointed at a .php script but I didn't even think of
that
because I didn't think it had anything to do with a favicon. As for how the
web
server is configure I'm not sure because I'm on a managed server so I don't
have
that access. I will test it with out the 404 redirect and get back to you.
------------------------------------------------------------------------
[2012-02-20 20:26:09] [email protected]
Wouldn't this only happen if you have your web server configured to send
favicon.ico request through PHP? Or, perhaps if you have a 404 handler pointed
at
a PHP script? In a normally configured web server I don't see this happening.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61148
--
Edit this bug report at https://bugs.php.net/bug.php?id=61148&edit=1