Scary Stuff...

Purdy on 2002-02-14T16:50:52

When I see this in an adopted script, I get very scared:

read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content =~ s///g;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}

$ENV{'QUERY_STRING'}=~s/%(..)/pack("c",hex($1))/ge;
@REFID=split(/-=-/,$ENV{'QUERY_STRING'});

Must ... convert ... to ... CGI.pm

Jason

PS: I saw that new <CITE> tag and got excited, thinking it was like a PRE tag, but no - it just italicizes everything. The CODE tag is merely a TT tag - I still gotta add those <BR>'s in there ... com'on ... let's get PRE in here! Please?


PRE

darobin on 2002-02-14T17:45:48

pudge (and presumably others) don't want <pre> in here because it would allow people to fuxor the layout (by entering very long lines). When I get five minutes of contiguous tuits, I'll prolly put a small pre2slash script that'll throw in the <br/> (err, <br>, XHTML doesn't work here), the &nbsp;, and try to take into account limitations in numbers of contiguous chars. No big deal, I just need those five minutes :)

Re:PRE

pudge on 2002-02-14T21:18:36

I'd really like to come up with a better solution to the problem, but I've not yet envisioned one, or had one described to me. Maybe I'll dream on it some night. Of course, my luck, I'll forget it as soon as I wake up.

Re:PRE

darobin on 2002-02-14T21:27:50

I haven't looked at the Everything engine code, but they have something that apparently can deal with proper formatting of code based on a given number of columns (it wraps beyond that width, and adds a small symbol at the end to indicate wrapping).

I'm not sure that this would solve the problem completely, but it could help.

Re:PRE

pudge on 2002-02-14T21:37:33

I don't like how they do it. I don't like the wrapping thing, I think it's hard to read and clumsy. I'm not saying they're wrong, I'd just prefer something else.

Re:PRE

chromatic on 2002-02-15T02:02:55

C'mon Pudge, I know you're capable of saying it's wrong. :) I think the filters in both Slash and Everything originally came from Dave DeMaagd a long, long time ago.

I'd like to revise the HTML parsing code anyway, but haven't finished writing tests.

Re:PRE

koschei on 2002-02-19T02:35:14

There'd be a user setting for the width surely? Thus you could set that to either 'off' or some ridiculously large value and have it disabled.

Others could have it as they like it.

Re:PRE

pudge on 2002-02-19T03:25:48

No. I don't like it, I won't work to implement it.

Re:PRE

koschei on 2002-02-19T03:35:54

What about if I submit a patch? (in the universe where I have spare time not spent arsing with journals =) )

Re:PRE

pudge on 2002-02-19T03:55:25

No ... you misunderstand. I don't like how it works. I don't want Slash to do it that way. There is another solution out there somewhere, and when I get some time, maybe I, or someone else, will think of it.

Re:PRE

koschei on 2002-02-19T04:14:08

Run code through a formatter set to a user-defined width? Not necessarily good.

Hmm.