MFB52?
Ilia Alshanetsky
On 26-Mar-09, at 8:53 AM, Felipe Pena wrote:
felipe Thu Mar 26 12:53:39 2009 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/pdo/tests bug47769.phpt
Modified files:
/php-src NEWS
/php-src/ext/pdo pdo_dbh.c
Log:
MFH: - Fixed bug #47769 (Strange extends PDO)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.537&r2=1.2027.2.547.2.965.2.538&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.537
php-src/NEWS:1.2027.2.547.2.965.2.538
--- php-src/NEWS:1.2027.2.547.2.965.2.537 Thu Mar 26 12:37:52 2009
+++ php-src/NEWS Thu Mar 26 12:53:39 2009
@@ -5,6 +5,7 @@
(Matteo)
- Fixed bug #47771 (Exception during object construction from arg
call calls
object's destructor). (Dmitry)
+- Fixed bug #47769 (Strange extends PDO). (Felipe)
- Fixed bug #47714 (autoloading classes inside exception_handler
leads to
crashes). (Dmitry)
- Fixed bug #47699 (autoload and late static binding). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.17.2.22&r2=1.82.2.31.2.17.2.23&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.22 php-src/ext/
pdo/pdo_dbh.c:1.82.2.31.2.17.2.23
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.22 Tue Feb 17
14:42:26 2009
+++ php-src/ext/pdo/pdo_dbh.c Thu Mar 26 12:53:39 2009
@@ -18,7 +18,7 @@
+
----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.22 2009/02/17 14:42:26
johannes Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.23 2009/03/26 12:53:39 felipe
Exp $ */
/* The PDO Database Handle Class */
@@ -1333,7 +1333,7 @@
lc_method_name = emalloc(method_len + 1);
zend_str_tolower_copy(lc_method_name, method_name, method_len);
- if (zend_hash_find(&dbh->ce->function_table, lc_method_name,
method_len+1, (void**)&fbc) == FAILURE) {
+ if ((fbc = std_object_handlers.get_method(object_pp, method_name,
method_len TSRMLS_CC)) == NULL) {
/* not a pre-defined method, nor a user-defined method; check
* the driver specific methods */
if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
@@ -1346,23 +1346,13 @@
if
(zend_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
lc_method_name, method_len+1, (void**)&fbc) ==
FAILURE) {
-
if (!fbc) {
fbc = NULL;
}
-
- goto out;
}
- /* got it */
}
out:
- if (!fbc) {
- if (std_object_handlers.get_method) {
- fbc = std_object_handlers.get_method(object_pp, method_name,
method_len TSRMLS_CC);
- }
- }
-
efree(lc_method_name);
return fbc;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug47769.phpt?view=markup&rev=1.1
Index: php-src/ext/pdo/tests/bug47769.phpt
+++ php-src/ext/pdo/tests/bug47769.phpt
--TEST--
Bug #47769 (Strange extends PDO)
--FILE--
<?php
class test extends PDO
{
protected function isProtected() {
echo "this is a protected method.\n";
}
private function isPrivate() {
echo "this is a private method.\n";
}
public function quote($str, $paramtype = NULL) {
$this->isProtected();
$this->isPrivate();
print $str ."\n";
}
}
$test = new test('sqlite:memory');
$test->quote('foo');
$test->isProtected();
?>
--EXPECTF--
this is a protected method.
this is a private method.
foo
Fatal error: Call to protected method test::isProtected() from
context '' in %s on line %d
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php