Skip to content

Commit b60fa9e

Browse files
committed
Mark PDO::__construct()'s password parameter as sensitive
1 parent 3485dc2 commit b60fa9e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/pdo/pdo_dbh.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "php_pdo.h"
2929
#include "php_pdo_driver.h"
3030
#include "php_pdo_int.h"
31+
#include "zend_attributes.h"
3132
#include "zend_exceptions.h"
3233
#include "zend_object_handlers.h"
3334
#include "zend_hash.h"
@@ -1423,6 +1424,13 @@ void pdo_dbh_init(void)
14231424

14241425
REGISTER_PDO_CLASS_CONST_LONG("CURSOR_FWDONLY", (zend_long)PDO_CURSOR_FWDONLY);
14251426
REGISTER_PDO_CLASS_CONST_LONG("CURSOR_SCROLL", (zend_long)PDO_CURSOR_SCROLL);
1427+
1428+
zend_add_parameter_attribute(
1429+
zend_hash_str_find_ptr(&pdo_dbh_ce->function_table, "__construct", sizeof("__construct") - 1),
1430+
2,
1431+
zend_ce_sensitive_parameter->name,
1432+
0
1433+
);
14261434
}
14271435

14281436
static void dbh_free(pdo_dbh_t *dbh, bool free_persistent)

0 commit comments

Comments
 (0)