1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

HTTP_Server: Temporary fix to handle broken links and images in 2019-05 enwiki [#524]

This commit is contained in:
gnosygnu 2019-08-03 10:04:11 -04:00
parent a1da02a99f
commit 66039fc9b3

View File

@ -136,10 +136,11 @@ public class Http_server_wkr implements Gfo_invk {
.Add_str_int("/exec/gfs" , Tid_post_url_gfs)
;
private static String Convert_page(String page_html, String root_dir_http, String wiki_domain) {
page_html = String_.Replace(page_html, "file:////home/lnxusr/xowa/file/", "/fsys/file/");
page_html = String_.Replace(page_html, root_dir_http , "/fsys/");
page_html = String_.Replace(page_html, "xowa-cmd:" , "/exec/");
page_html = String_.Replace(page_html, "<a href=\"/wiki/" , "<a href=\"/" + wiki_domain + "/wiki/");
page_html = String_.Replace(page_html, "<a href='/wiki/" , "<a href='/" + wiki_domain + "/wiki/");
page_html = String_.Replace(page_html, " href=\"/wiki/" , " href=\"/" + wiki_domain + "/wiki/");
page_html = String_.Replace(page_html, " href='/wiki/" , " href='/" + wiki_domain + "/wiki/");
page_html = String_.Replace(page_html, "action=\"/wiki/" , "action=\"/" + wiki_domain + "/wiki/");
page_html = String_.Replace(page_html, "/site" , "");
return page_html;