[android] #5725 - Cherry picking 559f3a654b

This commit is contained in:
Konstantin Käfer
2016-07-19 16:01:24 +02:00
committed by Brad Leege
parent a8cd7ecdfb
commit 6e830725de
2 changed files with 62 additions and 18 deletions

View File

@@ -82,10 +82,18 @@ std::string normalizeSpriteURL(const std::string& url, const std::string& access
std::string id, extension;
if (isDraft) {
size_t index = pathname[3].find_first_of("@.");
if (index == std::string::npos) {
Log::Error(Event::ParseStyle, "Invalid sprite URL");
return url;
}
id = pathname[2];
extension = pathname[3].substr(index);
} else {
size_t index = pathname[2].find_first_of("@.");
if (index == std::string::npos) {
Log::Error(Event::ParseStyle, "Invalid sprite URL");
return url;
}
id = pathname[2].substr(0, index);
extension = pathname[2].substr(index);
}