2016-11-25, 05:51 AM
https://community.mybb.com/thread-116019.html
inc/datahandlers/post.php
Why do we have if($this->action == "post") here? $this->action is null when previewing, throwing errors on users when "RE: " exceeds 85.
It still works, you can post it and code will remove this 4 chars on saving. But big red errors in users face when previewing is no good.
Solution - remove if($this->action == "post"), it should check for "RE: " always when subject is checked.
Also, this error is using $l['subject_too_long'] from contact.lang.php, and it should use $l['postdata_subject_too_long'] from datahandler_post.lang.php. They are the same though, so not a big deal, just noticing.
inc/datahandlers/post.php
$subject_length = my_strlen($subject);
if($this->action == "post")
{
$position_re = my_strpos($subject, "RE: ");
if($position_re !== false && $position_re == 0)
{
$subject_length = $subject_length - 4;
}
}
if($subject_length > 85)
{
// Subject is too long
$this->set_error('subject_too_long', my_strlen($subject));
return false;
}
Why do we have if($this->action == "post") here? $this->action is null when previewing, throwing errors on users when "RE: " exceeds 85.
It still works, you can post it and code will remove this 4 chars on saving. But big red errors in users face when previewing is no good.
Solution - remove if($this->action == "post"), it should check for "RE: " always when subject is checked.
Also, this error is using $l['subject_too_long'] from contact.lang.php, and it should use $l['postdata_subject_too_long'] from datahandler_post.lang.php. They are the same though, so not a big deal, just noticing.