diff options
| author | Ben Fuhrmannek | 2021-11-11 13:32:07 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-11-11 13:32:07 +0100 |
| commit | 0be11fcc6e73f7e35bf2f3b884676413f5522cf1 (patch) | |
| tree | 50b6d6108e069839f5715228c0b5623648a8514c /src/sp_disable_xxe.c | |
| parent | 713cb08b58d4e5dd5e7e80b1f82e27cbe52d4381 (diff) | |
more tests for xxe + optional xml support
Diffstat (limited to 'src/sp_disable_xxe.c')
| -rw-r--r-- | src/sp_disable_xxe.c | 7 |
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 | |||
| 3 | PHP_FUNCTION(sp_libxml_disable_entity_loader) { | 5 | PHP_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 | ||
| 45 | int 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 | ||
