php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4787 get_browser() still segments
Submitted: 2000-06-02 21:31 UTC Modified: 2001-04-28 12:51 UTC
From: liz at xcalibur dot co dot uk Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.0 Release OS: Slackware 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: liz at xcalibur dot co dot uk
New email:
PHP Version: OS:

 

 [2000-06-02 21:31 UTC] liz at xcalibur dot co dot uk
I have compiled PHP with

./configure' '--width-apache=/usr/src/apache-3.1.12' '--with-mysql' '--enable-track-vars' '--disable-debug' '--enable-calendar' '--enable-dbase' '--enable-ftp' '--enable-trans-sid' '--enable-inline-optimization' '--enable-discard-path'

I have tried every which way but loose to get this to work, even tried compiling up a CGI version. (as above but without apache)

OK, when I run it as a module, using the code for the get_browser() in the helpfile on here aka 

<?php
function list_array( $browser ) {
   while ( list( $key, $value ) = each( $browser ) ) {
          $str .= "<b>$key:</b> $value<br>\n";
   }
   return $str;
}
echo "$HTTP_USER_AGENT<hr>\n";
$browser = get_browser();
echo list_array( (array) $browser );
?>

All I get is 

Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
--------------------------------------------------------------------------------
 0: 

Whatever the browser/os is, I downloaded the browser.ini file from cyberscap I think - whereever it was PHP suggested, and I know its reading it, as if I break the ini file by making false entries it tells me - I checked that much

The CGI version does a segmentation fault.

A working example is on http://www.xcalibur.co.uk/browser.html


It also did it with 
./configure' '--width-apache=/usr/src/apache-3.1.12' 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-23 13:35 UTC] stas at cvs dot php dot net
Please try latest CVS and report what happens.
 [2000-07-23 18:42 UTC] liz at xcalibur dot co dot uk
That works very nicely, thank you.

Although, the code on the get_browser() page actually returned.

Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
--------------------------------------------------------------------------------
 browser_name_pattern: Mozilla/4\.0 (compatible; MSIE 5\.5; Windows 98)
parent: IE 5.0
version: 5.5
minorver: 5
platform: Win98
Beta: 1
browser: IE
Version: 5.0
majorver: 5
frames: 1
tables: 1
cookies: 1
backgroundsounds: 1
vbscript: 1
javascript: 1
javaapplets: 1
ActiveXControls: 1
Win16: 
beta: 
AK: 
SK: 
AOL: 
crawler: 
MSN: 
CDF: 1
DHTML: 1
XML: 1

(ie the browser name pattern had extra backslashes in before the fullstops - but that I suppose is a different problem)
 [2001-04-24 17:22 UTC] liz at xcalibur dot co dot uk
With 4.0.5RC7 this still occurs, it only worked for the CVS at the time it was closed. Its never worked before or since.

I can also recreate this on Mandrake as well. Oh, and it seems under windows 2000 pro/IIS5
 [2001-04-28 12:51 UTC] jmoore@php.net
This works in the latest CVS. (tested under Win2k (ISAPI & CGI) without and with browscap.ini) 

- James
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 05:01:27 2025 UTC