php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26998 browscap admin value not allowed in httpd.conf
Submitted: 2004-01-21 14:26 UTC Modified: 2004-01-21 14:46 UTC
From: mp at xmission dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.3.4 OS: Linux 2.4.24-ow1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mp at xmission dot com
New email:
PHP Version: OS:

 

 [2004-01-21 14:26 UTC] mp at xmission dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-21 14:39 UTC] sniper@php.net
browscap can ONLY be set in php.ini. This will not change.

 [2004-01-21 14:40 UTC] sniper@php.net
And FYI, only browscap.ini that works with PHP is found here:

  http://www.garykeith.com/browsers/downloads.asp


 [2004-01-21 14:46 UTC] mp at xmission dot com
Good enough. Thanks for the quick response.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 15:01:32 2024 UTC