mirror of
https://github.com/php/php-src.git
synced 2026-10-29 02:07:35 +08:00
* ext/sodium: add SensitiveParameter to missing functions * ext/phar: add SensitiveParameter to missing functions * ext/snmp: add SensitiveParameter to missing functions * ext/sqlite3: add SensitiveParameter to missing functions * ext/hash: add SensitiveParameter to missing functions
28 lines
886 B
PHP
28 lines
886 B
PHP
--TEST--
|
|
Test that the encryption key parameter of SQLite3::__construct() and SQLite3::open() is marked sensitive.
|
|
--EXTENSIONS--
|
|
sqlite3
|
|
--FILE--
|
|
<?php
|
|
try {
|
|
new SQLite3(':memory:', 'not-an-int', 'secret-key');
|
|
} catch (\Throwable $e) {
|
|
echo $e, PHP_EOL;
|
|
}
|
|
try {
|
|
$db = (new ReflectionClass(SQLite3::class))->newInstanceWithoutConstructor();
|
|
$db->open(':memory:', 'not-an-int', 'secret-key');
|
|
} catch (\Throwable $e) {
|
|
echo $e, PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
TypeError: SQLite3::__construct(): Argument #2 ($flags) must be of type int, string given in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): SQLite3->__construct(':memory:', 'not-an-int', Object(SensitiveParameterValue))
|
|
#1 {main}
|
|
TypeError: SQLite3::open(): Argument #2 ($flags) must be of type int, string given in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): SQLite3->open(':memory:', 'not-an-int', Object(SensitiveParameterValue))
|
|
#1 {main}
|