Skip to content

Commit

Permalink
fix read entity on libxml
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapmex committed Sep 22, 2024
1 parent b52adb1 commit 977f515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/colorer/xml/libxml2/LibXmlReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ xmlParserInputPtr LibXmlReader::xmlZipEntityLoader(const PathInJar& paths, const
static_cast<int>(unzipped_stream->size()), XML_CHAR_ENCODING_NONE);
xmlParserInputPtr pInput = xmlNewIOInputStream(ctxt, buf, XML_CHAR_ENCODING_NONE);

// заполняем filename для работы external entity
auto root_pos = paths.path_in_jar.lastIndexOf('/') + 1;
auto file_name = UnicodeString(paths.path_in_jar, root_pos);
pInput->filename = strdup(UStr::to_stdstr(&file_name).c_str());
return pInput;
}
#endif
Expand Down

0 comments on commit 977f515

Please sign in to comment.