ID:               26998
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mp at xmission dot com
 Status:           Bogus
 Bug Type:         PHP options/info functions
 Operating System: Linux 2.4.24-ow1
 PHP Version:      4.3.4
 New Comment:

And FYI, only browscap.ini that works with PHP is found here:

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




Previous Comments:
------------------------------------------------------------------------

[2004-01-21 14:39:07] [EMAIL PROTECTED]

browscap can ONLY be set in php.ini. This will not change.


------------------------------------------------------------------------

[2004-01-21 14:26:04] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26998&edit=1

Reply via email to