Skip to content

Commit

Permalink
Fixed issues caused by paths not being cleaned
Browse files Browse the repository at this point in the history
Hopefully without introducing issues due to paths being cleaned...

Not cleaning the path here resulted in the same tile image being
referred to by "different" paths (like containing "foo/.." or "bar/..",
where "foo" and "bar" are both irrelevant due to the path containing
"..").

This caused for example the automapping to not recognize that two
embedded tilesets were the same, if the files they were part of were not
in the same directory.

Closes #1713
  • Loading branch information
bjorn committed Sep 12, 2017
1 parent 39d5f75 commit e78aa05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libtiled/tiled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ QUrl Tiled::toUrl(const QString &filePathOrUrl, const QDir &dir)
return url;

// Resolve possible relative file reference
QString absolutePath = dir.filePath(filePathOrUrl);
QString absolutePath = QDir::cleanPath(dir.filePath(filePathOrUrl));
return QUrl::fromLocalFile(absolutePath);
}

0 comments on commit e78aa05

Please sign in to comment.