bdeccf5eb4b4e500a55d1339dd40413f3a4b9a35 max Tue Oct 13 18:58:52 2015 -0700 make wikiLink ready for non-root location, refs #16099 diff --git src/hg/lib/wikiLink.c src/hg/lib/wikiLink.c index a11db38..0f163b9 100644 --- src/hg/lib/wikiLink.c +++ src/hg/lib/wikiLink.c @@ -72,32 +72,33 @@ if (isNotEmpty(wikiLoggedIn) && isNotEmpty(wikiUserName)) { return cloneString(wikiUserName); } } else errAbort("wikiLinkUserName called when wiki is not enabled (specified " "in hg.conf)."); return NULL; } static char *encodedHgSessionReturnUrl(char *hgsid) /* Return a CGI-encoded hgSession URL with hgsid. Free when done. */ { char retBuf[1024]; -safef(retBuf, sizeof(retBuf), "http%s://%s/cgi-bin/hgSession?hgsid=%s", - cgiAppendSForHttps(), cgiServerNamePort(), hgsid); +char *cgiDir = cgiScriptDirUrl(); +safef(retBuf, sizeof(retBuf), "http%s://%s%shgSession?hgsid=%s", + cgiAppendSForHttps(), cgiServerNamePort(), cgiDir, hgsid); return cgiEncode(retBuf); } char *wikiLinkUserLoginUrlReturning(char *hgsid, char *returnUrl) /* Return the URL for the wiki user login page. */ { char buf[2048]; if (loginSystemEnabled()) { if (! wikiLinkEnabled()) errAbort("wikiLinkUserLoginUrl called when login system is not enabled " "(specified in hg.conf)."); safef(buf, sizeof(buf),