mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support to SecXMLExternalEntity
This commit is contained in:
@@ -41,13 +41,25 @@ XML::~XML() {
|
||||
|
||||
|
||||
bool XML::init() {
|
||||
// xmlParserInputBufferCreateFilenameFunc entity;
|
||||
// entity = xmlParserInputBufferCreateFilenameDefault(
|
||||
// this->unloadExternalEntity);
|
||||
xmlParserInputBufferCreateFilenameFunc entity;
|
||||
if (m_transaction->m_rules->secXMLExternalEntity == true) {
|
||||
entity = xmlParserInputBufferCreateFilenameDefault(
|
||||
__xmlParserInputBufferCreateFilename);
|
||||
} else {
|
||||
entity = xmlParserInputBufferCreateFilenameDefault(
|
||||
this->unloadExternalEntity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
xmlParserInputBufferPtr XML::unloadExternalEntity(const char *URI,
|
||||
xmlCharEncoding enc) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool XML::processChunk(const char *buf, unsigned int size) {
|
||||
/* We want to initialise our parsing context here, to
|
||||
* enable us to pass it the first chunk of data so that
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rules.h"
|
||||
|
||||
#ifndef SRC_REQUEST_BODY_PROCESSOR_XML_H_
|
||||
#define SRC_REQUEST_BODY_PROCESSOR_XML_H_
|
||||
@@ -48,7 +49,7 @@ class XML {
|
||||
bool processChunk(const char *buf, unsigned int size);
|
||||
bool complete();
|
||||
static xmlParserInputBufferPtr unloadExternalEntity(const char *URI,
|
||||
xmlCharEncoding enc) { return NULL; }
|
||||
xmlCharEncoding enc);
|
||||
|
||||
#ifndef NO_LOGS
|
||||
void debug(int a, std::string str) {
|
||||
|
Reference in New Issue
Block a user