@@ -497,14 +497,14 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
497497 zval * id , * docp = NULL ;
498498 xmlDoc * newdocp ;
499499 xsltStylesheetPtr sheetp ;
500- zend_string * ret_class = NULL ;
500+ zend_class_entry * ret_class = NULL ;
501501 xsl_object * intern ;
502502
503503 id = ZEND_THIS ;
504504 intern = Z_XSL_P (id );
505505 sheetp = (xsltStylesheetPtr ) intern -> ptr ;
506506
507- if (zend_parse_parameters (ZEND_NUM_ARGS (), "o|S !" , & docp , & ret_class ) == FAILURE ) {
507+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "o|C !" , & docp , & ret_class ) == FAILURE ) {
508508 RETURN_THROWS ();
509509 }
510510
@@ -513,7 +513,7 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
513513 if (newdocp ) {
514514 if (ret_class ) {
515515 zend_string * curclass_name ;
516- zend_class_entry * curce , * ce ;
516+ zend_class_entry * curce ;
517517 php_libxml_node_object * interndoc ;
518518
519519 curce = Z_OBJCE_P (docp );
@@ -522,16 +522,15 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
522522 curce = curce -> parent ;
523523 }
524524
525- ce = zend_lookup_class (ret_class );
526- if (ce == NULL || !instanceof_function (ce , curce )) {
525+ if (!instanceof_function (ret_class , curce )) {
527526 xmlFreeDoc (newdocp );
528- zend_argument_type_error (2 , "must be a class name compatible with %s, \"%s\" given" ,
529- ZSTR_VAL (curclass_name ), ZSTR_VAL (ret_class )
527+ zend_argument_type_error (2 , "must be a class name compatible with %s, %s given" ,
528+ ZSTR_VAL (curclass_name ), ZSTR_VAL (ret_class -> name )
530529 );
531530 RETURN_THROWS ();
532531 }
533532
534- object_init_ex (return_value , ce );
533+ object_init_ex (return_value , ret_class );
535534
536535 interndoc = Z_LIBXML_NODE_P (return_value );
537536 php_libxml_increment_doc_ref (interndoc , newdocp );
@@ -542,7 +541,6 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
542541 } else {
543542 RETURN_FALSE ;
544543 }
545-
546544}
547545/* }}} end XSLTProcessor::transformToDoc */
548546
0 commit comments