Skip to content

Commit afd1434

Browse files
committed
Address review feedback
1 parent 626d4c1 commit afd1434

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ PHP 8.4 UPGRADE NOTES
3939
for invalid modes. Previously invalid modes would have been interpreted as
4040
PHP_ROUND_HALF_UP.
4141

42+
- XSL:
43+
. The typed properties XSLTProcessor::$cloneDocument and
44+
XSLTProcessor::$doXInclude are now declared.
45+
4246
========================================
4347
2. New Features
4448
========================================

ext/xsl/php_xsl.stub.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@
7171

7272
class XSLTProcessor
7373
{
74-
/** @var bool */
75-
public $doXInclude;
74+
public bool $doXInclude = false;
7675

77-
/** @var bool */
78-
public $cloneDocument;
76+
public bool $cloneDocument = false;
7977

8078
/**
8179
* @param DOMDocument|SimpleXMLElement $stylesheet

ext/xsl/php_xsl_arginfo.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/xsl/xsltprocessor.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,8 @@ PHP_METHOD(XSLTProcessor, importStylesheet)
359359
intern = Z_XSL_P(id);
360360

361361
member = ZSTR_INIT_LITERAL("cloneDocument", 0);
362-
cloneDocu = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_IS, NULL, &rv);
363-
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
364-
convert_to_long(cloneDocu);
365-
clone_docu = Z_LVAL_P(cloneDocu);
366-
}
362+
cloneDocu = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_R, NULL, &rv);
363+
clone_docu = zend_is_true(cloneDocu);
367364
zend_string_release_ex(member, 0);
368365
if (clone_docu == 0) {
369366
/* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
@@ -460,11 +457,8 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
460457
ctxt->_private = (void *) intern;
461458

462459
member = ZSTR_INIT_LITERAL("doXInclude", 0);
463-
doXInclude = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_IS, NULL, &rv);
464-
if (Z_TYPE_P(doXInclude) != IS_NULL) {
465-
convert_to_long(doXInclude);
466-
ctxt->xinclude = Z_LVAL_P(doXInclude);
467-
}
460+
doXInclude = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_R, NULL, &rv);
461+
ctxt->xinclude = zend_is_true(doXInclude);
468462
zend_string_release_ex(member, 0);
469463

470464
secPrefsValue = intern->securityPrefs;

0 commit comments

Comments
 (0)