Skip to content

Commit 27198c2

Browse files
committed
Address review feedback
1 parent ed65211 commit 27198c2

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ PHP 8.4 UPGRADE NOTES
4343
. XSLTProcessor::setParameter() will now throw a ValueError when its arguments
4444
contain null bytes. This never actually worked correctly in the first place,
4545
which is why it throws an exception nowadays.
46+
. The typed properties XSLTProcessor::$cloneDocument and
47+
XSLTProcessor::$doXInclude are now declared.
4648

4749
========================================
4850
2. New Features

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
@@ -313,11 +313,8 @@ PHP_METHOD(XSLTProcessor, importStylesheet)
313313
intern = Z_XSL_P(id);
314314

315315
member = ZSTR_INIT_LITERAL("cloneDocument", 0);
316-
cloneDocu = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_IS, NULL, &rv);
317-
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
318-
convert_to_long(cloneDocu);
319-
clone_docu = Z_LVAL_P(cloneDocu);
320-
}
316+
cloneDocu = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_R, NULL, &rv);
317+
clone_docu = zend_is_true(cloneDocu);
321318
zend_string_release_ex(member, 0);
322319
if (clone_docu == 0) {
323320
/* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
@@ -415,11 +412,8 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
415412
}
416413

417414
member = ZSTR_INIT_LITERAL("doXInclude", 0);
418-
doXInclude = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_IS, NULL, &rv);
419-
if (Z_TYPE_P(doXInclude) != IS_NULL) {
420-
convert_to_long(doXInclude);
421-
ctxt->xinclude = Z_LVAL_P(doXInclude);
422-
}
415+
doXInclude = zend_std_read_property(Z_OBJ_P(id), member, BP_VAR_R, NULL, &rv);
416+
ctxt->xinclude = zend_is_true(doXInclude);
423417
zend_string_release_ex(member, 0);
424418

425419
secPrefsValue = intern->securityPrefs;

0 commit comments

Comments
 (0)