yes, it becomes escaped \n as well, I am trying to find what my insertion code is missing that properly makes new lines accepted.
Ok I think I understood it? This is from the newthread.php:
escapes are not used at all in there, then further looking at the post handler the escaping is automatically done there.
So I am technically double escaping it hence why it doesn't work. So in the outside layer I don't have to worry about escaping it and when I send it to the post handler it will do all the work?
Did I get it right?
Ok I think I understood it? This is from the newthread.php:
// Set up posthandler.
require_once MYBB_ROOT."inc/datahandlers/post.php";
$posthandler = new PostDataHandler("insert");
$posthandler->action = "thread";
// Set the thread data that came from the input to the $thread array.
$new_thread = array(
"fid" => $forum['fid'],
"subject" => $mybb->get_input('subject'),
"prefix" => $mybb->get_input('threadprefix', MyBB::INPUT_INT),
"icon" => $mybb->get_input('icon', MyBB::INPUT_INT),
"uid" => $uid,
"username" => $username,
"message" => $mybb->get_input('message'),
"ipaddress" => $session->packedip,
"posthash" => $mybb->get_input('posthash')
);
$posthandler->set_data($new_thread);
escapes are not used at all in there, then further looking at the post handler the escaping is automatically done there.
$this->post_insert_data = array(
"subject" => $db->escape_string($thread['subject']),
"icon" => (int)$thread['icon'],
"username" => $db->escape_string($thread['username']),
"dateline" => (int)$thread['dateline'],
"message" => $db->escape_string($thread['message']),
"ipaddress" => $db->escape_binary(my_inet_pton(get_ip())),
"includesig" => $thread['options']['signature'],
"smilieoff" => $thread['options']['disablesmilies'],
"visible" => $visible
);
So I am technically double escaping it hence why it doesn't work. So in the outside layer I don't have to worry about escaping it and when I send it to the post handler it will do all the work?
Did I get it right?