From:             
Operating system: FreeBSD7.3 (amd64)
PHP version:      5.3.10
Package:          *General Issues
Bug Type:         Bug
Bug description:auto_prepend_file and auto_append_file seemingly load on 
favicon request

Description:
------------
Pages that are loaded with auto_prepend_file and auto_append_file load
multiple 
times per page request if there is no favicon.ico located in the root
directory.  
I believe this only happens with chrome and IE, have not been able to
replicate 
the issue with firefox.

You will see using this configuration, if you load index.php your database
will 
get at least 2 entries, one for '/index.php', and one for and one for 
'/favicon.ico/'

This might just be a matter of appending the documentation if this is
deemed "not 
a bug" because according the php.net manual auto_prepend_file and
auto_append_file 
should function exactly as the require() function.  However if this code
was put 
in index.php as "require('prepend.php')" instead of being autoloaded it
would 
always only load once.

Test script:
---------------
.htaccess:
php_value  auto_prepend_file /path_to_file/prepend.php

prepend.php:
<?php 
$mysqli = new mysqli('localhost', 'user', 'pass', 'database');
$mysqli->query("INSERT INTO uri_test (uri, time) VALUES
('$_SERVER[REQUEST_URI]',now())");
?>

Expected result:
----------------
expected result is that the prepend.php file only runs once per page load.

Actual result:
--------------
prepend.php loads when the browser is seemingly requesting the URI for the

favicon.ico

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61148&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61148&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61148&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61148&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61148&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61148&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61148&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61148&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61148&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61148&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61148&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61148&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61148&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61148&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61148&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61148&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61148&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61148&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61148&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61148&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61148&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61148&r=mysqlcfg

Reply via email to