2006-04-21
: The Marginalia Code
In light of, y'know, learning a thing or two, I've edited the meat out of this post. It remains a mere husk of its former self.
Here's what happens when you click "Submit, Monkey!" underneath "This reminds me..."
snip
What happens when you click "Submit, Monkey!" underneath "This makes me go..." is very similar:
snip
So that's two tables in my database, reminds and responds. The "entryid" field contains the id of the main post; the "commentid" field contains the id of the particular comment.
Here's what happens wrt marginalia when the code displays a comment:
snip
Anybody interested in more?
1. On 2006-04-21, Vincent wrote:
By the way, what I'm ashamed of is not having written any of it in subroutines. It's all just inline in front of God and everybody.
There's like way too many places for SQL injection there. Someone could, seriously, delete your weblog with a single comment. Back it up now.
And then contact me, and I'll help you out or something. My heart just jumped in my throat when I saw exactly how a jerk - which, by the way, there's plenty of Vincent-hating jerks who know SQL and PHP - could erase all your hard work.
- Clinton
This makes...
CRN go "Test"*
BR go "Clinton is like the sherif, man..."*
I'm relatively new to php, but I know a thing or two and would be glad to help, either in terms of pointers ( i came too late to the thread to see the code) or in terms of (benign) testing. Lemme know - I think you have my email. Sounds like Clinton's basically got your back, though.
Yow. I just had to edit a marginalia post to escape some stuff that was causing the SQL to bomb out -- at least apply a regexp to your variables like s/'/'/g, which avoids most of the trivial sql hacking bugs (as well as letting people post things with apostrophes without getting "sql error" on the result side).
This makes...
mneme go "bah"*
mneme go "or..."*
VB go "done, anyway, I'm pretty sure."*
mneme go "*sigh*"*
mneme go "yup"*
VB go "HTML ESCAPING! DAMMIT!"*
JL go "There's always more..."*
mneme go "no, that's just wrong"*
mneme go "yes..."*
mneme go "preview would be nice"*
That's an unrelated thing. Apostrophes in marginalia worked fine until Textdrive updated their PHP like 10 days ago.
That, this, and plus an idea I have for maybe bettering the social contract around here point to a ground-up redesign. Expect not much activity for a little while.
Textdrive, hey? I just downloaded and installed that on my laptop over the weekend, for fiddling around with. Thinking about the Marginalia gave me some ideas about AJAX-y comment threading that I may want to try out, if I can figure out the hard parts.
This makes...
AG go "Textpattern is what I meant"*
I don't know if this is an error per se, but my aggregator is reading all apostrophes (') as ('). Of course my aggregator already doesn't properly parse your <(br)/>s, so it's not a big deal.