rejetto forum

bug in the code into procedure getUri()

Mars · 4 · 4996

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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 :-[


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i don't understand from the html example.
can you tell me an example URL where the result is bad?



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile