+ Fix deal with relative urls

This commit is contained in:
kelson42 2014-05-07 17:33:38 +02:00
parent 005b75f7ab
commit 587b76bf6d
2 changed files with 7 additions and 1 deletions

View File

@ -375,8 +375,13 @@ namespace kiwix {
return this->getContentByEncodedUrl(url, content, contentLength, contentType); return this->getContentByEncodedUrl(url, content, contentLength, contentType);
} }
bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl) {
return this->getContentByDecodedUrl(kiwix::urlDecode(url), content, contentLength, contentType, baseUrl);
}
bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) { bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {
return this->getContentByDecodedUrl(kiwix::urlDecode(url), content, contentLength, contentType); std::string stubRedirectUrl;
return this->getContentByEncodedUrl(kiwix::urlDecode(url), content, contentLength, contentType, stubRedirectUrl);
} }
bool Reader::getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) { bool Reader::getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {

View File

@ -62,6 +62,7 @@ namespace kiwix {
bool getFavicon(string &content, string &mimeType); bool getFavicon(string &content, string &mimeType);
bool getPageUrlFromTitle(const string &title, string &url); bool getPageUrlFromTitle(const string &title, string &url);
bool getContentByUrl(const string &url, string &content, unsigned int &contentLength, string &contentType); bool getContentByUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl);
bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType); bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl); bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl);
bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType); bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);