From 27c3706b10f9bf450317422d17ee48454e0e1462 Mon Sep 17 00:00:00 2001 From: riderkick Date: Sun, 2 Aug 2015 00:53:34 +0800 Subject: [PATCH] baseunit, don't strip host on fillhost --- baseunits/uBaseUnit.pas | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/baseunits/uBaseUnit.pas b/baseunits/uBaseUnit.pas index 2bfe380e2..ff4c4bfc0 100644 --- a/baseunits/uBaseUnit.pas +++ b/baseunits/uBaseUnit.pas @@ -1394,18 +1394,17 @@ function FillMangaSiteHost(const Website, URL: String): String; function FillHost(const Host, URL: String): String; var - th, tu: string; + tu: string; begin Result := URL; if Host = '' then Exit; with TRegExpr.Create do try Expression := REGEX_HOST; - th := Replace(Host, '$1$2$3', True); tu := Replace(URL, '$4', True); if tu = '' then tu := URL; - Result := th + AppendURLDelimLeft(tu); + Result := RemoveURLDelim(Host) + AppendURLDelimLeft(tu); finally Free; end; @@ -1413,7 +1412,7 @@ function FillHost(const Host, URL: String): String; function MaybeFillHost(const Host, URL: String): String; var - th, tu: string; + tu: string; begin Result := URL; if Host = '' then Exit; @@ -1422,11 +1421,10 @@ function MaybeFillHost(const Host, URL: String): String; Expression := REGEX_HOST; if Replace(URL, '$1', True) = '' then begin - th := Replace(Host, '$1$2$3', True); tu := Replace(URL, '$4', True); if tu = '' then tu := URL; - Result := th + AppendURLDelimLeft(tu); + Result := RemoveURLDelim(Host) + AppendURLDelimLeft(tu); end; finally Free;