@@ -333,11 +333,11 @@ PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
333
333
if (curnode -> type == XML_ELEMENT_NODE ) {
334
334
/* This ensures that namespace references in this subtree are defined within this subtree,
335
335
* otherwise a use-after-free would be possible when the original namespace holder gets freed. */
336
- php_libxml_node_ptr * ptr = curnode -> _private ;
336
+ const php_libxml_node_ptr * ptr = curnode -> _private ;
337
337
338
338
/* Checking in case it runs out of reference */
339
339
if (ptr -> _private ) {
340
- php_libxml_node_object * obj = ptr -> _private ;
340
+ const php_libxml_node_object * obj = ptr -> _private ;
341
341
if (!obj -> document || obj -> document -> class_type < PHP_LIBXML_CLASS_MODERN ) {
342
342
xmlReconciliateNs (curnode -> doc , curnode );
343
343
}
@@ -524,7 +524,7 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
524
524
525
525
/* Check if there's been an external transport protocol with an encoding information */
526
526
if (enc == XML_CHAR_ENCODING_NONE ) {
527
- php_stream * s = (php_stream * ) context ;
527
+ const php_stream * s = (php_stream * ) context ;
528
528
zend_string * charset = php_libxml_sniff_charset_from_stream (s );
529
529
if (charset != NULL ) {
530
530
enc = xmlParseCharEncoding (ZSTR_VAL (charset ));
@@ -934,7 +934,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
934
934
}
935
935
}
936
936
937
- PHP_LIBXML_API void php_libxml_switch_context (zval * context , zval * oldcontext )
937
+ PHP_LIBXML_API void php_libxml_switch_context (const zval * context , zval * oldcontext )
938
938
{
939
939
if (oldcontext ) {
940
940
ZVAL_COPY_VALUE (oldcontext , & LIBXML (stream_context ));
@@ -1268,7 +1268,7 @@ int php_libxml_xmlCheckUTF8(const unsigned char *s)
1268
1268
return 1 ;
1269
1269
}
1270
1270
1271
- zval * php_libxml_register_export (zend_class_entry * ce , php_libxml_export_node export_function )
1271
+ zval * php_libxml_register_export (const zend_class_entry * ce , php_libxml_export_node export_function )
1272
1272
{
1273
1273
php_libxml_func_handler export_hnd ;
1274
1274
@@ -1284,11 +1284,11 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object)
1284
1284
xmlNodePtr node = NULL ;
1285
1285
1286
1286
if (Z_TYPE_P (object ) == IS_OBJECT ) {
1287
- zend_class_entry * ce = Z_OBJCE_P (object );
1287
+ const zend_class_entry * ce = Z_OBJCE_P (object );
1288
1288
while (ce -> parent != NULL ) {
1289
1289
ce = ce -> parent ;
1290
1290
}
1291
- php_libxml_func_handler * export_hnd = zend_hash_find_ptr (& php_libxml_exports , ce -> name );
1291
+ const php_libxml_func_handler * export_hnd = zend_hash_find_ptr (& php_libxml_exports , ce -> name );
1292
1292
if (export_hnd ) {
1293
1293
node = export_hnd -> export_func (object );
1294
1294
}
0 commit comments