LPS-43142 use relative URL for web content links because they point to the wrong portal instance when remote staging
LPS-43142 rename method and sort
LPS-43142 Source formatting
LPS-43142 making the fix more robust by checking for portalURL before returning the substring