@@ -497,14 +497,14 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
497
497
zval * id , * docp = NULL ;
498
498
xmlDoc * newdocp ;
499
499
xsltStylesheetPtr sheetp ;
500
- zend_string * ret_class = NULL ;
500
+ zend_class_entry * ret_class = NULL ;
501
501
xsl_object * intern ;
502
502
503
503
id = ZEND_THIS ;
504
504
intern = Z_XSL_P (id );
505
505
sheetp = (xsltStylesheetPtr ) intern -> ptr ;
506
506
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 ) {
508
508
RETURN_THROWS ();
509
509
}
510
510
@@ -513,7 +513,7 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
513
513
if (newdocp ) {
514
514
if (ret_class ) {
515
515
zend_string * curclass_name ;
516
- zend_class_entry * curce , * ce ;
516
+ zend_class_entry * curce ;
517
517
php_libxml_node_object * interndoc ;
518
518
519
519
curce = Z_OBJCE_P (docp );
@@ -522,16 +522,15 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
522
522
curce = curce -> parent ;
523
523
}
524
524
525
- ce = zend_lookup_class (ret_class );
526
- if (ce == NULL || !instanceof_function (ce , curce )) {
525
+ if (!instanceof_function (ret_class , curce )) {
527
526
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 )
530
529
);
531
530
RETURN_THROWS ();
532
531
}
533
532
534
- object_init_ex (return_value , ce );
533
+ object_init_ex (return_value , ret_class );
535
534
536
535
interndoc = Z_LIBXML_NODE_P (return_value );
537
536
php_libxml_increment_doc_ref (interndoc , newdocp );
@@ -542,7 +541,6 @@ PHP_METHOD(XSLTProcessor, transformToDoc)
542
541
} else {
543
542
RETURN_FALSE ;
544
543
}
545
-
546
544
}
547
545
/* }}} end XSLTProcessor::transformToDoc */
548
546
0 commit comments