From 0be11fcc6e73f7e35bf2f3b884676413f5522cf1 Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Thu, 11 Nov 2021 13:32:07 +0100 Subject: more tests for xxe + optional xml support --- src/sp_disable_xxe.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sp_disable_xxe.c') diff --git a/src/sp_disable_xxe.c b/src/sp_disable_xxe.c index 7db2451..b6030c6 100644 --- a/src/sp_disable_xxe.c +++ b/src/sp_disable_xxe.c @@ -1,5 +1,7 @@ #include "php_snuffleupagus.h" +#ifdef HAVE_XML + PHP_FUNCTION(sp_libxml_disable_entity_loader) { sp_log_warn("xxe", "A call to libxml_disable_entity_loader was tried and nopped"); @@ -39,3 +41,8 @@ int hook_libxml_disable_entity_loader() { return SUCCESS; } +#else +int hook_libxml_disable_entity_loader() { + sp_log_warn("xxe", "Cannot enable XXE protection. XML support is disabled in PHP."); +} +#endif \ No newline at end of file -- cgit v1.3