From 6e4f4eb73c158ad11c37c9c7a421f7fd7971d7c5 Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Mon, 9 May 2016 20:57:12 +0900 Subject: [PATCH] Remove the Asterisk mark and Question mark in decrypt resource path --- common/resource_manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/resource_manager.cc b/common/resource_manager.cc index 349a38f..c00d965 100644 --- a/common/resource_manager.cc +++ b/common/resource_manager.cc @@ -577,6 +577,11 @@ std::string ResourceManager::DecryptResource(const std::string& path) { src_path.erase(0, strlen(kSchemeTypeFile)); } + // Remove the parameters at the end of an href attribute + size_t end_of_path = src_path.find_first_of("?#"); + if (end_of_path != std::string::npos) + src_path = src_path.substr(0, end_of_path); + FILE *src = fopen(src_path.c_str(), "rb"); if (!src) { LOGGER(ERROR) << "Cannot open file for decryption: " << src_path; -- 2.7.4