summaryrefslogtreecommitdiff
path: root/src/sp_disable_xxe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_disable_xxe.c')
-rw-r--r--src/sp_disable_xxe.c7
1 files changed, 7 insertions, 0 deletions
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 @@
1#include "php_snuffleupagus.h" 1#include "php_snuffleupagus.h"
2 2
3#ifdef HAVE_XML
4
3PHP_FUNCTION(sp_libxml_disable_entity_loader) { 5PHP_FUNCTION(sp_libxml_disable_entity_loader) {
4 sp_log_warn("xxe", 6 sp_log_warn("xxe",
5 "A call to libxml_disable_entity_loader was tried and nopped"); 7 "A call to libxml_disable_entity_loader was tried and nopped");
@@ -39,3 +41,8 @@ int hook_libxml_disable_entity_loader() {
39 41
40 return SUCCESS; 42 return SUCCESS;
41} 43}
44#else
45int hook_libxml_disable_entity_loader() {
46 sp_log_warn("xxe", "Cannot enable XXE protection. XML support is disabled in PHP.");
47}
48#endif \ No newline at end of file