Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported operand types in src/phpbrowscap/Browscap.php on line 356 #48

Open
reva2 opened this issue Nov 21, 2013 · 1 comment
Open

Comments

@reva2
Copy link

reva2 commented Nov 21, 2013

Library can't properly handle some user agents strings and show this errors:

PHP Notice:  Undefined index:  in /var/www/vendor/garetjax/phpbrowscap/src/phpbrowscap/Browscap.php on line 355
PHP Fatal error:  Unsupported operand types in /var/www/vendor/garetjax/phpbrowscap/src/phpbrowscap/Browscap.php on line 356

Some samples of user agents strings causing these errors

mozilla/5.0 (windows; u; windows nt 6.1; en-us) applewebkit/534.3 (khtml, like gecko) chrome/6.0.472.33 safari/534.3 se 2.x metasr 1.0
mozilla/5.0 (windows; u; windows nt 5.1; en-us) applewebkit/534.0 (khtml, like gecko) chrome/6.0.408.1 safari/534.0

Tested with latest lite php version of browscap.ini (5020 Jul 29 2013).

This error occurs in phpbrowsecap versions: 2.0b and dev-master.

Please let me know if you need additional details.

@reva2
Copy link
Author

reva2 commented Nov 21, 2013

This issue can be related to issue #36.

The same UA string correctly works with standart and full versions of browscap.ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant