rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: Mars on May 18, 2009, 12:01:51 AM

Title: bug in the code into procedure getUri()
Post by: Mars on May 18, 2009, 12:01:51 AM
result:=getTill('?', s);   give a bug by duplicate the path into the url after the ?

the old line   result:=chop('?', s);  is the best solution

Quote
  procedure getUri();
  var
    i, j: integer;
    vars: Tstrings;
    s: string;
  begin
  if not satisfied(md.cd) then exit;
  result:=md.cd.conn.request.url;
  if pars.count < 2 then exit;
  s:=result;
//  result:=getTill('?', s);   //old by rejetto
  result:=chop('?', s);   //restored by mars
  vars:=TstringList.create();
  try
    vars.delimiter:='&';
    vars.quoteChar:=#0;
    vars.delimitedText:=s;
    if pars.count > 1 then

le problème à été constaté sur le serveur de silentpliz en utilisant le petit template suivant

Quote
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<script language="JavaScript" type="text/JavaScript">
function Prefresh() {
  window.location="{.get|url|text=.}";
};
</script>
</head>
<body>
<button onclick="Prefresh()">click here</button>
</body>
</html>



vraiment pas cool :-[
Title: Re: bug in the code into procedure getUri()
Post by: rejetto on May 18, 2009, 09:55:20 AM
i don't understand from the html example.
can you tell me an example URL where the result is bad?
Title: Re: bug in the code into procedure getUri()
Post by: SilentPliz on May 18, 2009, 01:02:40 PM
Starts the template provided by mars > click several times on the button >  watch the address bar of your browser ...

the result is:  :o

eg:

http://localhost:44300/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/?/1_Envois%20de%20Fichiers/&text= ....

Normally the result should be:

1 click = http://localhost:44300/1_Envois%20de%20Fichiers/?text=
1 click = http://localhost:44300/1_Envois%20de%20Fichiers/
1 click = http://localhost:44300/1_Envois%20de%20Fichiers/?text=
1 click = http://localhost:44300/1_Envois%20de%20Fichiers/
etc... etc...
Title: Re: bug in the code into procedure getUri()
Post by: rejetto on May 18, 2009, 02:52:30 PM
ok, sorry for it :)