File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ PHP NEWS
2121- PCRE:
2222 . Fixed bug #77827 (preg_match does not ignore \r in regex flags). (requinix,
2323 cmb)
24+
25+ - PDO:
26+ . Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
27+ (camporter)
2428
2529- phpdbg:
2630 . Fixed bug #76801 (too many open files). (alekitto)
Original file line number Diff line number Diff line change @@ -1390,6 +1390,7 @@ void pdo_dbh_init(void)
13901390 pdo_dbh_object_handlers .offset = XtOffsetOf (pdo_dbh_object_t , std );
13911391 pdo_dbh_object_handlers .dtor_obj = zend_objects_destroy_object ;
13921392 pdo_dbh_object_handlers .free_obj = pdo_dbh_free_storage ;
1393+ pdo_dbh_object_handlers .clone_obj = NULL ;
13931394 pdo_dbh_object_handlers .get_method = dbh_method_get ;
13941395 pdo_dbh_object_handlers .compare_objects = dbh_compare ;
13951396 pdo_dbh_object_handlers .get_gc = dbh_get_gc ;
Original file line number Diff line number Diff line change 1+ --TEST--
2+ PDO Common: Bug #77849 (Unexpected segfault attempting to use cloned PDO object)
3+ --SKIPIF--
4+ <?php
5+ if (!extension_loaded ('pdo ' )) die ('skip ' );
6+ $ dir = getenv ('REDIR_TEST_DIR ' );
7+ if (false == $ dir ) die ('skip no driver ' );
8+ require_once $ dir . 'pdo_test.inc ' ;
9+ PDOTest::skip ();
10+ ?>
11+ --FILE--
12+ <?php
13+ if (getenv ('REDIR_TEST_DIR ' ) === false ) putenv ('REDIR_TEST_DIR= ' .dirname (__FILE__ ) . '/../../pdo/tests/ ' );
14+ require_once getenv ('REDIR_TEST_DIR ' ) . 'pdo_test.inc ' ;
15+
16+ $ db = PDOTest::factory ();
17+ $ db2 = clone $ db ;
18+ ?>
19+ --EXPECTF--
20+ Fatal error: Uncaught Error: Trying to clone an uncloneable object of class PDO in %s
21+ Stack trace:
22+ #0 {main}
23+ thrown in %s on line %d
You can’t perform that action at this time.
0 commit comments