0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #5109 from ErisDS/issue-5064

Remove duplicate subdirectory in RSS urls
This commit is contained in:
Matt Enlow 2015-04-09 08:35:25 -06:00
commit 920856c479

View file

@ -562,6 +562,11 @@ frontendControllers = {
// as the base URL, otherwise use the post's URL.
baseUrl = attributeValue[0] === '/' ? siteUrl : item.url;
// prevent double subdirectoreis
if (attributeValue.indexOf(config.paths.subdir) === 0) {
attributeValue = attributeValue.replace(config.paths.subdir, '');
}
// prevent double slashes
if (baseUrl.slice(-1) === '/' && attributeValue[0] === '/') {
attributeValue = attributeValue.substr(1);