Skip to content

Commit a0cd0cb

Browse files
committed
Fix compilation on libxml2 2.13
1 parent fc09f4b commit a0cd0cb

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

ext/dom/document.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,11 +1429,13 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source,
14291429
if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) {
14301430
options |= XML_PARSE_NOBLANKS;
14311431
}
1432+
if (recover) {
1433+
options |= XML_PARSE_RECOVER;
1434+
}
14321435

14331436
php_libxml_sanitize_parse_ctxt_options(ctxt);
14341437
xmlCtxtUseOptions(ctxt, options);
14351438

1436-
ctxt->recovery = recover;
14371439
if (recover) {
14381440
old_error_reporting = EG(error_reporting);
14391441
EG(error_reporting) = old_error_reporting | E_WARNING;
@@ -1443,7 +1445,7 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source,
14431445

14441446
if (ctxt->wellFormed || recover) {
14451447
ret = ctxt->myDoc;
1446-
if (ctxt->recovery) {
1448+
if (recover) {
14471449
EG(error_reporting) = old_error_reporting;
14481450
}
14491451
/* If loading from memory, set the base reference uri for the document */

ext/libxml/libxml.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,10 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
544544
static xmlOutputBufferPtr
545545
php_libxml_output_buffer_create_filename(const char *URI,
546546
xmlCharEncodingHandlerPtr encoder,
547-
int compression ATTRIBUTE_UNUSED)
547+
int compression)
548548
{
549+
ZEND_IGNORE_VALUE(compression);
550+
549551
xmlOutputBufferPtr ret;
550552
xmlURIPtr puri;
551553
void *context = NULL;

ext/libxml/php_libxml.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,15 @@ ZEND_TSRMLS_CACHE_EXTERN()
258258
* Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */
259259
static zend_always_inline void php_libxml_sanitize_parse_ctxt_options(xmlParserCtxtPtr ctxt)
260260
{
261+
ZEND_DIAGNOSTIC_IGNORED_START("-Wdeprecated-declarations") \
261262
ctxt->loadsubset = 0;
262263
ctxt->validate = 0;
263264
ctxt->pedantic = 0;
264265
ctxt->replaceEntities = 0;
265266
ctxt->linenumbers = 0;
266267
ctxt->keepBlanks = 1;
267268
ctxt->options = 0;
269+
ZEND_DIAGNOSTIC_IGNORED_END
268270
}
269271

270272
#else /* HAVE_LIBXML */

0 commit comments

Comments
 (0)