Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ PHP NEWS
. Fixed bug GH-19994 (openssl_get_cipher_methods inconsistent with fetching).
(Jakub Zelenka)

- PDO:
. Fixed bug GH-20095 (Incorrect class name in deprecation message for PDO
mixins). (timwolla)

- Phar:
. Fix potential buffer length truncation due to usage of type int instead
of type size_t. (Girgias)
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/pdo_dbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ bool pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
func.type = ZEND_INTERNAL_FUNCTION;
func.handler = funcs->handler;
func.function_name = zend_string_init(funcs->fname, strlen(funcs->fname), dbh->is_persistent);
func.scope = dbh_obj->std.ce;
func.scope = pdo_dbh_ce;
func.prototype = NULL;
ZEND_MAP_PTR(func.run_time_cache) = rt_cache_size ? pecalloc(rt_cache_size, 1, dbh->is_persistent) : NULL;
func.T = ZEND_OBSERVER_ENABLED;
Expand Down
25 changes: 25 additions & 0 deletions ext/pdo_sqlite/tests/gh20095.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
GH-20095: Incorrect class name in deprecation message for PDO mixins
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php

class Foo extends PDO {
private function test() {
echo "foo";
}

public function register() {
$this->sqliteCreateFunction('my_test', [$this, "test"]);
}
}

$pdo = new Foo('sqlite::memory:');
$pdo->register();
$pdo->query("SELECT my_test()");

?>
--EXPECTF--
Deprecated: Method PDO::sqliteCreateFunction() is deprecated since 8.5, use Pdo\Sqlite::createFunction() instead in %s on line %d
foo