php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch bug69983.phpt for Unknown/Other Function Bug #69983

Patch version 2015-07-03 18:42 UTC

Return to Bug #69983 | Download this patch
Patch Revisions:

Developer: cmb@php.net

 sapi/cli/tests/bug69983.phpt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/sapi/cli/tests/bug69983.phpt b/sapi/cli/tests/bug69983.phpt
new file mode 100644
index 0000000..bc08dba
--- /dev/null
+++ b/sapi/cli/tests/bug69983.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #69983 (get_browser fails with user agent of null)
+--INI--
+allow_url_fopen=1
+user_agent=Mozilla/4.0
+--SKIPIF--
+<?php
+include "skipif.inc";
+$browscap = __DIR__ . '/../../../ext/standard/tests/misc/browscap.ini';
+if(!is_readable($browscap)) {
+    die("skip: browscap.ini file $browscap not readable");
+}
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+$browscap = __DIR__ . '/../../../ext/standard/tests/misc/browscap.ini';
+php_cli_server_start(
+    'var_dump(get_browser(NULL)->browser);',
+    'index.php',
+    "-d browscap=$browscap"
+);
+echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS);
+?>
+--EXPECT--
+string(7) "Inktomi"
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Nov 27 14:05:53 2022 UTC