summaryrefslogtreecommitdiff
path: root/ext/xsl
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-05-31 11:57:22 +0300
committerDmitry Stogov <dmitry@zend.com>2018-05-31 11:57:22 +0300
commitf2b4ec4bdc595773fb49b7d6ae8942c61f436288 (patch)
tree528873c7a446929a9298aaaaad4b6cef805fdc69 /ext/xsl
parent0d72bb8fcb0b2d658f9a40e473207f4a1f66df91 (diff)
downloadphp-git-f2b4ec4bdc595773fb49b7d6ae8942c61f436288.tar.gz
Export standard object handlers, to avoid indirect access
Diffstat (limited to 'ext/xsl')
-rw-r--r--ext/xsl/php_xsl.c2
-rw-r--r--ext/xsl/xsltprocessor.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index faa3fe488e..5e485c9c91 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -128,7 +128,7 @@ PHP_MINIT_FUNCTION(xsl)
zend_class_entry ce;
- memcpy(&xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ memcpy(&xsl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
xsl_object_handlers.offset = XtOffsetOf(xsl_object, std);
xsl_object_handlers.clone_obj = NULL;
xsl_object_handlers.free_obj = xsl_objects_free_storage;
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index bde382ad1b..17536c5cbe 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -399,7 +399,6 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
xsl_object *intern;
int prevSubstValue, prevExtDtdValue, clone_docu = 0;
xmlNode *nodep = NULL;
- const zend_object_handlers *std_hnd;
zval *cloneDocu, member, rv;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
@@ -435,9 +434,8 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
intern = Z_XSL_P(id);
- std_hnd = zend_get_std_object_handlers();
ZVAL_STRING(&member, "cloneDocument");
- cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
+ cloneDocu = zend_std_read_property(id, &member, BP_VAR_IS, NULL, &rv);
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
convert_to_long(cloneDocu);
clone_docu = Z_LVAL_P(cloneDocu);
@@ -483,7 +481,6 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
char **params = NULL;
int clone;
zval *doXInclude, member, rv;
- const zend_object_handlers *std_hnd;
FILE *f;
int secPrefsError = 0;
int secPrefsValue;
@@ -533,10 +530,8 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
ctxt = xsltNewTransformContext(style, doc);
ctxt->_private = (void *) intern;
- std_hnd = zend_get_std_object_handlers();
-
ZVAL_STRING(&member, "doXInclude");
- doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
+ doXInclude = zend_std_read_property(id, &member, BP_VAR_IS, NULL, &rv);
if (Z_TYPE_P(doXInclude) != IS_NULL) {
convert_to_long(doXInclude);
ctxt->xinclude = Z_LVAL_P(doXInclude);