Skip to content

Commit d708bf7

Browse files
committed
keep testing chr(0) in DSN
1 parent c6afdf8 commit d708bf7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ MySQLPDOTest::skip();
3838
}
3939

4040
if ($fp = @fopen($file, 'w')) {
41-
$dsnUnknownDatabase = preg_replace('~dbname=[^;]+~', 'dbname=letshopeinvalid', $dsn);
41+
$dsnUnknownDatabase = preg_replace('~dbname=[^;]+~', 'dbname=letshopeinvalid', $dsn)
42+
. chr(0) . ';host=nonsense;unix_socket=nonsense';
4243
fwrite($fp, $dsnUnknownDatabase);
4344
fclose($fp);
4445
clearstatcache();
@@ -60,8 +61,6 @@ MySQLPDOTest::skip();
6061

6162
}
6263

63-
/* TODO: safe mode */
64-
6564
} catch (PDOException $e) {
6665
printf("[001] %s, [%s] %s\n",
6766
$e->getMessage(),
@@ -72,5 +71,5 @@ MySQLPDOTest::skip();
7271
print "done!";
7372
?>
7473
--EXPECTF--
75-
[003] URI=uri:file://%spdomuri.tst, DSN=mysql:%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql:%sdbname=letshopeinvalid%S'), EXPECTED ERROR
74+
[003] URI=uri:file://%spdomuri.tst, DSN=mysql:%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql:%sdbname=letshopeinvalid%snonsense'), EXPECTED ERROR
7675
done!

0 commit comments

Comments
 (0)