| 92 | } |
| 93 | |
| 94 | std::string NormalizeResourceName(std::string_view resourceName) { |
| 95 | std::string normalized(resourceName); |
| 96 | for (char& ch : normalized) { |
| 97 | if (ch == '\\') { |
| 98 | ch = '/'; |
| 99 | } |
| 100 | } |
| 101 | while (!normalized.empty() && normalized.front() == '/') { |
| 102 | normalized.erase(normalized.begin()); |
| 103 | } |
| 104 | return normalized; |
| 105 | } |
| 106 | |
| 107 | bool IsSafeZipResourceName(const std::string& name) { |
| 108 | if (name.empty() || IsAbsolutePath(name)) { |
no test coverage detected