mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Remove path sanitize for file drops (#611)
This commit is contained in:
+1
-20
@@ -408,25 +408,6 @@ extern "C" void OTRExtScanner() {
|
||||
}
|
||||
}
|
||||
|
||||
std::string SanitizePath(std::string stringValue) {
|
||||
// Add backslashes.
|
||||
for (auto i = stringValue.begin();;) {
|
||||
auto const pos =
|
||||
std::find_if(i, stringValue.end(), [](char const c) { return '\\' == c || '\'' == c || '"' == c; });
|
||||
if (pos == stringValue.end()) {
|
||||
break;
|
||||
}
|
||||
i = std::next(stringValue.insert(pos, '\\'), 2);
|
||||
}
|
||||
|
||||
// Removes others.
|
||||
stringValue.erase(std::remove_if(stringValue.begin(), stringValue.end(),
|
||||
[](char const c) { return '\n' == c || '\r' == c || '\0' == c || '\x1A' == c; }),
|
||||
stringValue.end());
|
||||
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
void Ben_ProcessDroppedFiles(std::string filePath) {
|
||||
SPDLOG_INFO("Processing dropped file: {}", filePath);
|
||||
|
||||
@@ -676,7 +657,7 @@ extern "C" void Graph_StartFrame() {
|
||||
#endif
|
||||
|
||||
if (CVarGetInteger(CVAR_NEW_FILE_DROPPED, 0)) {
|
||||
std::string filePath = SanitizePath(CVarGetString(CVAR_DROPPED_FILE, ""));
|
||||
std::string filePath = CVarGetString(CVAR_DROPPED_FILE, "");
|
||||
if (!filePath.empty()) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnFileDropped>(filePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user