From:             mp at xmission dot com
Operating system: Linux 2.4.24-ow1
PHP version:      4.3.4
PHP Bug Type:     PHP options/info functions
Bug description:  browscap admin value not allowed in httpd.conf

Description:
------------
Using 'php_admin_value browscap [path to browscap.ini]' in httpd.conf does
not set the value of 'browscap'. It of course does set the value of
'browscap' correctly if it is set in php.ini directly. 

This is considered a bug to me because we have a number of virtual hosting
customers for whom we would like to be able to specify the value of
browscap for their individual sites. 

As evidenced by a number of other closed bugs, Apache will in fact
segfault in the event that 'php_admin_value browscap ...' is set in
httpd.conf. 

For this to work properly imho, 'php_admin_value browscap' should be
allowed in httpd.conf so that it can be turned on and off for different
sites and so different users can use different browscap.ini files.

Reproduce code:
---------------
<?

$USERAGENT = $_SERVER['HTTP_USER_AGENT'];
echo "<h3>$USERAGENT</h3>\n"; flush();
$brow_obj = get_browser($USERAGENT);
echo "brow_obj=$brow_obj\n<br>\n"; flush();
$browser = get_object_vars($brow_obj);
echo "browser=$browser\n<br>\n"; flush();
echo "<pre>\n"; print_r($browser); echo "\n</pre>\n"; flush();
echo "\n\nAGENT=$USERAGENT\n"; array_print($browser);
echo "\n(c=".$browser['crawler']." js=".$browser['javascript']."
t=".$browser['tables']." css=".$browser['css'].")\n-->\n\n";
$WEBBOT=0;
if ($browser['browser_name_pattern']!='.*' &&
    ($browser['crawler']!="" || $browser['javascript']=="")) {
  $WEBBOT=1;
  if (!$nooutput) {
    echo "web bot or non-javascript browser: do not use javascript (c=".
      $browser['crawler']." js=".$browser[javascript].") -->\n";
  }
} elseif (!$nooutput) {  
  echo $browser['browser_name_pattern']." is not a web bot: ".
    "use javascript (c=".$browser['crawler'].
    " js=".$browser['javascript'].") -->\n";
}  


Expected result:
----------------
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031225
Firebird/0.7
brow_obj=Object
browser=Array

Array
(
    [browser_name_regex] => Mozilla/5\.0 (X11; U; Linux.*; .*; rv:.*)
Gecko/........ Firebird/0\.7.*
    [browser_name_pattern] => Mozilla/5.0 (X11; U; Linux*; *; rv:*)
Gecko/???????? Firebird/0.7*
    [parent] => Firebird 0.7
    [platform] => Linux
    [browser] => Firebird
    [version] => 0.7
    [majorver] => 0
    [minorver] => 7
    [css] => 2
    [frames] => 1
    [iframes] => 1
    [tables] => 1
    [cookies] => 1
    [backgroundsounds] => 
    [vbscript] => 
    [javascript] => 1
    [javaapplets] => 1
    [activexcontrols] => 
    [cdf] => 
    [aol] => 
    [beta] => 1
    [win16] => 
    [crawler] => 
    [stripper] => 
    [wap] => 
    [netclr] => 
)



Actual result:
--------------
ozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031225 Firebird/0.7

-- 
Edit bug report at http://bugs.php.net/?id=26998&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26998&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26998&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26998&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26998&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26998&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26998&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26998&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26998&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26998&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26998&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26998&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26998&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26998&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26998&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26998&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26998&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26998&r=float

Reply via email to