1 (edited by elbekko 2007-06-21 12:10)

Topic: Insert query in post.php

In the posts table, hide_smilies is defined as an integer:

hide_smilies TINYINT(1) NOT NULL DEFAULT 0

Yet in post.php, it is being inserted as a character:

$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());

I encountered this error when porting PunBB to Sybase, which wasn't too keen on this implicit conversion.

EDIT: edit.php has this 'bug' too, on line 127.