From: Jamie C. <jca...@we...> - 2003-11-05 23:45:54
|
After testing this a bit more, it seems that most browsers do use a + to represent a space, so webmin really does have to convert it back in the ReadParse function. Annoyingly, some programs don't properly convert a + into a %43 in the URL, causing problems like you found .. - Jamie Larry Gilson wrote: > I don't really know Jamie. You can tell by the history of my messages that > I am in new teritory with this. From other ReadParse subroutine examples, > it looks like Webmin's ReadParse function is working correctly. The most > common example I found was using + to replace a space in input strings for > search engines. So the ReadParse replacement of a + by a space appears to > be common, I just did not have a clue. I am glad I checked the code though. > The online docs and your book did not indicate that I could omit the > replacement function. It was a bonus to find this. > > One thing I guess I would be at a loss for though is how would I solve this > problem if I had a multi-part form in which some input would need to have > the + escaped and some would not? > > Thanks Jamie! > > --Larry > > > > >>-----Original Message----- >>From: Jamie Cameron [mailto:jca...@we...] >>Sent: Wednesday, November 05, 2003 5:12 AM >>To: web...@li... >>Subject: Re: [webmin-devel] RE: Problem with value assigned >>to text entry field >> >> >>I'm surprised that the + isn't properly escaped whatever is >>generating those URLs in the first place, as it is my >>understanding that this is part of the HTML/HTTP >>form-parameter standard. However, I could be wrong, and it >>may be that webmin should never replace a + with a space like this. >> >> - Jamie >> >>On Wed, 2003-11-05 at 07:40, Larry Gilson wrote: >> >>>Ok, so I now understand the relationship of the '+' and space. >>>The real answer was to escape the plus lies in 'sub ReadParse'. >>>The format listed in web-lib.pl is: >>> >>> ReadParse([&assoc], [method], [noplus]) >>> >>>So all I needed to do is change from: >>> >>> ReadParse(); >>> >>>To: >>> >>> ReadParse(undef, undef, 2); >>> >>>That did the trick! >>> >>>I did not find the above format in either the online docs >>>or Jamie's book. I only found it in web-lib.pl. >>> >>>--Larry >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: Larry Gilson >>>>Sent: Tuesday, November 04, 2003 2:51 PM >>>>To: 'web...@li...' >>>>Subject: FW: Problem with value assigned to text entry field >>>> >>>> >>>>After reading ReadParse() in web-lib.pl, I assume the >>>>replacement of a '+' with a space is by design. Can anyone >>>>tell me why. I have spent some time trying to find out but >>>>either I don't understand the answer or I have not found it >>>>yet. More importantly, does anyone know how I can counter this. >>>> >>>>Thanks, >>>>Larry >>>> >>>> >>>> >>>>-----Original Message----- >>>>From: Larry Gilson >>>>Sent: Monday, November 03, 2003 11:56 PM >>>>To: 'web...@li...' >>>>Subject: Problem with value assigned to text entry field >>>> >>>> >>>>Hi All, >>>> >>>>Hopefully someone with more experience here might be able to >>>>help me. This seems like a trivial problem but I just >>>>can't see it. >>>> >>>>I am trying to modify squidGuard regular expressions. The >>>>file is read by read_file_lines(). It is properly output to >>>>a hyper link. On selecting the hyperlink, the form data is >>>>then read by &ReadParse(). No rocket science here. The odd >>>>thing is that a '+' is substituted by a space. >>>> >>>>Example: >>>>Hyperlink: (^|[-.\?+=/_0-9])(john|mary) >>>>Script reads: (^|[-.\? =/_0-9])(john|mary) >>>> >>>> >>>> >>>>The hyperlink is created by the following (sorry for the wrap): >>>> >>>>print " <TD WIDTH=100%><A >>>>HREF=\"edit_blexpr.cgi?blacklist=$in{'blacklist'}&entry=$entry >>>>\"><TT>", >>>> (length($entry) > 80) ? substr($entry, 0, >>>>80)."..." : $entry, >>>> "</TT></A></TD>\n"; >>>> >>>>The variable in question is $entry. The script reading this >>>>output refers to $in{'entry'}. >>>> >>>>Can anyone see what I am missing? >>>> >>>> >>>>Thanks, >>>>Larry |