mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Backport deprecation warning ignores to unbreak CI
This commit is contained in:
commit
f3ee902c3d
2 changed files with 25 additions and 2 deletions
|
@ -149,12 +149,30 @@ PHP_LIBXML_API void php_libxml_shutdown(void);
|
||||||
ZEND_TSRMLS_CACHE_EXTERN()
|
ZEND_TSRMLS_CACHE_EXTERN()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_START \
|
||||||
|
_Pragma("clang diagnostic push") \
|
||||||
|
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_END \
|
||||||
|
_Pragma("clang diagnostic pop")
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_START \
|
||||||
|
_Pragma("GCC diagnostic push") \
|
||||||
|
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_END \
|
||||||
|
_Pragma("GCC diagnostic pop")
|
||||||
|
#else
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_START
|
||||||
|
# define PHP_LIBXML_IGNORE_DEPRECATIONS_END
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Other extension may override the global state options, these global options
|
/* Other extension may override the global state options, these global options
|
||||||
* are copied initially to ctxt->options. Set the options to a known good value.
|
* are copied initially to ctxt->options. Set the options to a known good value.
|
||||||
* See libxml2 globals.c and parserInternals.c.
|
* See libxml2 globals.c and parserInternals.c.
|
||||||
* The unique_name argument allows multiple sanitizes and restores within the
|
* The unique_name argument allows multiple sanitizes and restores within the
|
||||||
* same function, even nested is necessary. */
|
* same function, even nested is necessary. */
|
||||||
#define PHP_LIBXML_SANITIZE_GLOBALS(unique_name) \
|
#define PHP_LIBXML_SANITIZE_GLOBALS(unique_name) \
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_START \
|
||||||
int xml_old_loadsubset_##unique_name = xmlLoadExtDtdDefaultValue; \
|
int xml_old_loadsubset_##unique_name = xmlLoadExtDtdDefaultValue; \
|
||||||
xmlLoadExtDtdDefaultValue = 0; \
|
xmlLoadExtDtdDefaultValue = 0; \
|
||||||
int xml_old_validate_##unique_name = xmlDoValidityCheckingDefaultValue; \
|
int xml_old_validate_##unique_name = xmlDoValidityCheckingDefaultValue; \
|
||||||
|
@ -162,15 +180,18 @@ ZEND_TSRMLS_CACHE_EXTERN()
|
||||||
int xml_old_pedantic_##unique_name = xmlPedanticParserDefault(0); \
|
int xml_old_pedantic_##unique_name = xmlPedanticParserDefault(0); \
|
||||||
int xml_old_substitute_##unique_name = xmlSubstituteEntitiesDefault(0); \
|
int xml_old_substitute_##unique_name = xmlSubstituteEntitiesDefault(0); \
|
||||||
int xml_old_linenrs_##unique_name = xmlLineNumbersDefault(0); \
|
int xml_old_linenrs_##unique_name = xmlLineNumbersDefault(0); \
|
||||||
int xml_old_blanks_##unique_name = xmlKeepBlanksDefault(1);
|
int xml_old_blanks_##unique_name = xmlKeepBlanksDefault(1); \
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_END
|
||||||
|
|
||||||
#define PHP_LIBXML_RESTORE_GLOBALS(unique_name) \
|
#define PHP_LIBXML_RESTORE_GLOBALS(unique_name) \
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_START \
|
||||||
xmlLoadExtDtdDefaultValue = xml_old_loadsubset_##unique_name; \
|
xmlLoadExtDtdDefaultValue = xml_old_loadsubset_##unique_name; \
|
||||||
xmlDoValidityCheckingDefaultValue = xml_old_validate_##unique_name; \
|
xmlDoValidityCheckingDefaultValue = xml_old_validate_##unique_name; \
|
||||||
(void) xmlPedanticParserDefault(xml_old_pedantic_##unique_name); \
|
(void) xmlPedanticParserDefault(xml_old_pedantic_##unique_name); \
|
||||||
(void) xmlSubstituteEntitiesDefault(xml_old_substitute_##unique_name); \
|
(void) xmlSubstituteEntitiesDefault(xml_old_substitute_##unique_name); \
|
||||||
(void) xmlLineNumbersDefault(xml_old_linenrs_##unique_name); \
|
(void) xmlLineNumbersDefault(xml_old_linenrs_##unique_name); \
|
||||||
(void) xmlKeepBlanksDefault(xml_old_blanks_##unique_name);
|
(void) xmlKeepBlanksDefault(xml_old_blanks_##unique_name); \
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_END
|
||||||
|
|
||||||
/* Alternative for above, working directly on the context and not setting globals.
|
/* Alternative for above, working directly on the context and not setting globals.
|
||||||
* Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */
|
* Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */
|
||||||
|
|
|
@ -350,8 +350,10 @@ PHP_METHOD(XSLTProcessor, importStylesheet)
|
||||||
newdoc = xmlCopyDoc(doc, 1);
|
newdoc = xmlCopyDoc(doc, 1);
|
||||||
xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL);
|
xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL);
|
||||||
PHP_LIBXML_SANITIZE_GLOBALS(parse);
|
PHP_LIBXML_SANITIZE_GLOBALS(parse);
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_START
|
||||||
xmlSubstituteEntitiesDefault(1);
|
xmlSubstituteEntitiesDefault(1);
|
||||||
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||||
|
PHP_LIBXML_IGNORE_DEPRECATIONS_END
|
||||||
|
|
||||||
sheetp = xsltParseStylesheetDoc(newdoc);
|
sheetp = xsltParseStylesheetDoc(newdoc);
|
||||||
PHP_LIBXML_RESTORE_GLOBALS(parse);
|
PHP_LIBXML_RESTORE_GLOBALS(parse);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue