diff --git a/app/models/communication/website/page/with_path.rb b/app/models/communication/website/page/with_path.rb index b92c9d7635788e8d57924d31930d08eb5aa47b25..56a4a55d5ff3228588b94b7361247f89deb2ba9a 100644 --- a/app/models/communication/website/page/with_path.rb +++ b/app/models/communication/website/page/with_path.rb @@ -29,7 +29,10 @@ module Communication::Website::Page::WithPath return unless published return if website.url.blank? # do not use a global Static.clean here because url has protocol with 2 slashes! - "#{website.url.end_with?('/') ? website.url[0..-2] : website.url}#{Static.clean_path path}" + website_url = website.url + # remove trailing slash if needed, because path begins with a slash + website_url = website_url[0..-2] if website_url[0..-2].end_with?('/') + "#{website_url}#{Static.clean_path path}" end protected