ZF-11541: PHP error notices raised in Zend_Http_UserAgent class and subclasses
Description
The code is not handling non existing array keys which is causing many PHP notices to be logged.
The code is not handling non existing array keys which is causing many PHP notices to be logged.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2011-07-12T19:19:01.000+0000
Can you provide some exemplar output displaying the notices? This will help us identify where in the code-base we need to add checks.
Posted by Martin Minka (k2s) on 2011-07-28T18:53:49.000+0000
this was in deed very bad problem description, shame on me
my environment: * Zend from tag release-1.11.7 * detecting mobile devices with WURFL * testing with XPERIA Mini
PHP log messages:
PHP Notice: Undefined offset: 1 in Zend/Http/UserAgent/AbstractDevice.php on line 558 PHP Notice: Undefined offset: 1 in Zend/Http/UserAgent/AbstractDevice.php on line 573 PHP Notice: Undefined offset: 1 in Zend/Http/UserAgent/AbstractDevice.php on line 585 PHP Notice: Undefined offset: 1 in Zend/Http/UserAgent/AbstractDevice.php on line 586
It is only PHP Notice of course. The whole extractFromUserAgent() is written in a way that it may raise many more notices.
What about filling in $results with some defaults in begin of the method ?
Posted by Matthew Weier O'Phinney (matthew) on 2011-08-02T18:09:09.000+0000
Can you check against the code in current trunk? I think this may be resolved already via ZF-11557.
Posted by Martin Minka (k2s) on 2011-08-04T05:49:54.000+0000
yes, seams to be fixed. thank you
Posted by Ramon Henrique Ornelas (ramon) on 2011-08-13T09:38:35.000+0000
Fixed with issue ZF-11557.