This commit is contained in:
Green
2025-08-30 22:23:19 +03:00
parent 1491bd8802
commit e6da8e50f5

View File

@ -3,7 +3,8 @@
#include "../../OfficeUtils/src/OfficeUtils.h" #include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/xml/include/xmlutils.h" #include "../../DesktopEditor/xml/include/xmlutils.h"
#include "../../HtmlFile2/htmlfile2.h" #include "../../HtmlFile2/htmlfile2.h"
#include "../../DesktopEditor/raster/BgraFrame.h" #include "../../DesktopEditor/common/Path.h"
#include "../../DesktopEditor/common/ProcessEnv.h"
#include "src/CBookInfo.h" #include "src/CBookInfo.h"
#include <iostream> #include <iostream>
@ -158,10 +159,17 @@ HRESULT CEpubFile::Convert(const std::wstring& sInputFile, const std::wstring& s
oFile.SetCoreDirectory(NSFile::GetDirectoryName(sContent)); oFile.SetCoreDirectory(NSFile::GetDirectoryName(sContent));
std::vector<std::wstring> arFiles; std::vector<std::wstring> arFiles;
for (const CBookContentItem& oContent : m_arContents) for (const CBookContentItem& oContent : m_arContents)
{ {
std::wstring sFile = m_mapRefs[oContent.m_sID].GetRef(); std::wstring sFile = NSSystemPath::ShortenPath(m_mapRefs[oContent.m_sID].GetRef());
replace_all(sFile, L"%20", L" "); replace_all(sFile, L"%20", L" ");
if (sFile.length() > 3 && L'.' == sFile[0] && L'.' == sFile[1] && L'/' == sFile[2] &&
NSProcessEnv::IsPresent(NSProcessEnv::Converter::gc_allowPrivateIP) &&
!NSProcessEnv::GetBoolValue(NSProcessEnv::Converter::gc_allowPrivateIP))
continue;
arFiles.push_back(m_sTempDir + ((!sContentPath.empty()) ? (L"/" + sContentPath) : L"" ) + L"/" + sFile); arFiles.push_back(m_sTempDir + ((!sContentPath.empty()) ? (L"/" + sContentPath) : L"" ) + L"/" + sFile);
} }