Closed Jemt closed 4 years ago
Perhaps extensions should be allowed to supply information about their virtual directories, e.g.: SMEnvironment::RegisterVirtualDirectory("shop"); Should apply to both root and subsites since /shop is used for both root and subsites: /sites/xyx/shop
Fixed - GetRequestPath() and GetExternalUrl() are now capable of excluding virtual directories automatically.
SMEnvironment::GetExternalUrl() and SMEnvironment::GetRequestPath() both includes the /shop portion when called on a product page.
Example return value when called from http://localhost:8880/SMCMS/shop/Smartphones: http://localhost:8880/SMCMS/shop
While we could argue that GetRequestPath() behaves as expected, in most scenaries it seems the usage expects it to return the path to the root of Sitemagic CMS. GetRequestPath() actually replaced GetInstallationPath() which was intended to return the root path, so we need to make GetRequestPath() behave this way.
GetExternalUrl() obviously does not work as expected.
Consider adding a collection of known paths that is to be substracted from the return values of GetExternalUrl() and GetRequestPath().