Jump to content


Photo

ProcessHTML


  • Please log in to reply
3 replies to this topic

#1 Michael Cessna

Michael Cessna
  • Members
  • 10 posts

Posted 17 June 2008 - 05:39 AM

I noticed that some URLs are not processed correctly in ProcessHTML (NxSharedCommon.pas). URLs that have an equal sign ("=") in the URL are have problems (e.g. "http://www.weather.c...=0&when=071906"). I've worked around this by the adding a FoundEqual Boolean variable and using it as follows:

CODE
var
FoundEqual: Boolean;
begin
FoundEqual := False;
...etc.
end else if (c = '=') and not FoundEqual then
begin
ParamValueReading := True;
ParamNameReading := False;
ParamValueBuffer := '';
FoundEqual := True;
end


This code makes the assumption that there is only one attribute, and may not work in other circumstances, but it suits my particular needs ok. Anyway, it's something to take a look at, as far as how to solve properly.

Thanks

Mike

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 June 2008 - 01:37 PM

Hello Michael,

I will test it and add it.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 June 2008 - 02:50 PM

Hello,

Maybe is better to put next line:

CODE
end else if c = '=' then


into

CODE
end else if (c = '=') and not OpenQuote then


This will ignore all '=' chars if quotes are open. Please tell me what you think.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 Michael Cessna

Michael Cessna
  • Members
  • 10 posts

Posted 17 June 2008 - 05:13 PM

Nice idea, thanks.

Mike




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users