Skip to content

Commit

Permalink
baseunit, don't strip host on fillhost
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Aug 1, 2015
1 parent 4a8fe4e commit 27c3706
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions baseunits/uBaseUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1394,26 +1394,25 @@ 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;
end;

function MaybeFillHost(const Host, URL: String): String;
var
th, tu: string;
tu: string;
begin
Result := URL;
if Host = '' then Exit;
Expand All @@ -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;
Expand Down

0 comments on commit 27c3706

Please sign in to comment.