Skip to content

Commit

Permalink
#5108: Fix MapResource's file extension calculation, since the resour…
Browse files Browse the repository at this point in the history
…ce path can contain ".." that might fool os::getExtension()
  • Loading branch information
codereader committed Nov 27, 2020
1 parent 86bb90c commit 4ef43f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion radiantcore/map/MapResource.cpp
Expand Up @@ -68,7 +68,9 @@ void MapResource::rename(const std::string& fullPath)

void MapResource::constructPaths(const std::string& resourcePath)
{
_extension = os::getExtension(resourcePath);
// Since the resource path can contain dots like this ".."
// pass the filename part only to getExtension().
_extension = os::getExtension(os::getFilename(resourcePath));

// Try to find a folder part of the VFS and use that as base path
// Will result to an empty string if the path is outside the VFS
Expand Down

0 comments on commit 4ef43f7

Please sign in to comment.