xsltStylesheetPtr sheetp, oldsheetp;
xsl_object *intern;
php_libxml_node_object *docobj;
- int prevSubstValue, prevExtDtdValue, clone_docu;
+ int prevSubstValue, prevExtDtdValue, clone_docu = 0;
xmlNode *nodep;
zend_object_handlers *std_hnd;
zval *cloneDocu, *member;
MAKE_STD_ZVAL(member);
ZVAL_STRING(member, "cloneDocument", 0);
cloneDocu = std_hnd->read_property(id, member, 1 TSRMLS_CC);
- convert_to_long(cloneDocu);
+ if (Z_TYPE_P(cloneDocu) != IS_NULL) {
+ convert_to_long(cloneDocu);
+ clone_docu = Z_LVAL_P(cloneDocu);
+ }
efree(member);
- clone_docu = Z_LVAL_P(cloneDocu);
if (clone_docu == 0) {
/* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
nodep = xmlDocGetRootElement(sheetp->doc)->children;