cvs: pear /Net_UserAgent Detect.php

From: Date: Fri, 01 Nov 2002 06:27:34 +0000
Subject: cvs: pear /Net_UserAgent Detect.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-7256@lists.php.net to get a copy of this message
dallen Fri Nov 1 01:27:34 2002 EDT Modified files: /pear/Net_UserAgent Detect.php Log: * fixed a notice error when the user agent is empty Index: pear/Net_UserAgent/Detect.php diff -u pear/Net_UserAgent/Detect.php:1.4 pear/Net_UserAgent/Detect.php:1.5 --- pear/Net_UserAgent/Detect.php:1.4 Tue Oct 29 18:54:54 2002 +++ pear/Net_UserAgent/Detect.php Fri Nov 1 01:27:34 2002 @@ -17,7 +17,7 @@ // | Authors: Dan Allen <dan@mojavelinux.com> | // +----------------------------------------------------------------------+ -// $Id: Detect.php,v 1.4 2002/10/29 23:54:54 dallen Exp $ +// $Id: Detect.php,v 1.5 2002/11/01 06:27:34 dallen Exp $ // }}} // {{{ description @@ -246,8 +246,10 @@ $os = array_flip($os); // Get the type and version of the client - preg_match(";^([[:alpha:]]+)[ /\(]*[[:alpha:]]*([\d]*)(\.[\d\.]*);", $agt, $matches); - list($null, $this->leadingIdentifier, $this->majorVersion, $this->subVersion) = $matches; + if (preg_match(";^([[:alpha:]]+)[ /\(]*[[:alpha:]]*([\d]*)(\.[\d\.]*);", $agt, $matches)) { + list(, $this->leadingIdentifier, $this->majorVersion, $this->subVersion) = $matches; + } + if (empty($this->leadingIdentifier)) { $this->leadingIdentifier = 'Unknown'; }

« previous php.pear.cvs (#7256) next »