docs: public String substituteLinkForUnknownTarget(
          CmsObject cms,
          String link,
          String targetDetailPage,
          boolean forceSecure) {
  
          if (CmsStringUtil.isEmpty(link)) {
              return "";
          }
          String sitePath = link;
          String siteRoot = null;
          if (hasScheme(link)) {
              // the link has a scheme, that is starts with something like "http://"
              // usually this should be a link to an external resource, but check anyway
              sitePath = getRootPath(cms, link);
              if (sitePath == null) {
                  // probably an external link, don't touch this
                  return link;
              }
          }
          // check if we can find a site from the link
          siteRoot = OpenCms.getSiteManager().getSiteRoot(sitePath);
          if (siteRoot == null) {
              // use current site root in case no valid site root is available
              // this will also be the case if a "/system" link is used
              siteRoot = cms.getRequestContext().getSiteRoot();
          } else {
              // we found a site root, cut this from the resource path
              sitePath = sitePath.substring(siteRoot.length());
          }
          return substituteLink(cms, sitePath, siteRoot, targetDetailPage, forceSecure);
      }