Quote:
Originally Posted by Ian Montgomerie
I found a bug, but I'm not sure how to fix it or even if it's fixable. If a user has an apostrophe in their user name, SQL gives an error when they try to insert into the database.
|
Indeed, it's fixable. Sorry about that. I'll correct it in the next upload, which is currently being tested.
In the meantime, if you want a fix:
- Edit local_links.php.
- Find function record_hit($id, $url, $status), which in version 1.22 is at line 1827
Replace
PHP Code:
$DB_site->query("
INSERT INTO ".THIS_TABLE."linksdownloads (linkid, linkurl, username, userid, userip, userbrowser, usertime)
VALUES (
'".$id."',
'".$url."',
'".$username."',
'".$userid."',
'".$userip."',
'".$userbrowser."',
$time
)
");
with
PHP Code:
$DB_site->query("
INSERT INTO ".THIS_TABLE."linksdownloads (linkid, linkurl, username, userid, userip, userbrowser, usertime)
VALUES (
'".$id."',
'".$url."',
'".addslashes(htmlspecialchars($username))."',
'".$userid."',
'".$userip."',
'".addslashes(htmlspecialchars($userbrowser))."',
$time
)
");