XF 1.1 Error Please enter a message with no more than 140 characters??

nguyenhuuhung

Active member
hello
I encountered a error and i want to get the help of you.

When i Send a message profile.An error occurred

Please enter a message with no more than 140 characters.

I want my message more than 140 characters.

How do i install?

Thanks.!!!
gtwb.png
 
It's hard-coded:

library/XenForo/DataWriter/DiscussionMessage/ProfilePost.php

Code:
	protected function _messagePreSave()
	{
		if ($this->get('user_id') == $this->get('profile_user_id') && $this->isChanged('message'))
		{
			// statuses are more limited than other posts
			$message = $this->get('message');
			$maxLength = 140;

			$message = preg_replace('/\r?\n/', ' ', $message);

			if (utf8_strlen($message) > $maxLength)
			{
				$this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
			}

			$this->set('message', $message);
		}
	}
 
It's hard-coded:

library/XenForo/DataWriter/DiscussionMessage/ProfilePost.php

Code:
    protected function _messagePreSave()
    {
        if ($this->get('user_id') == $this->get('profile_user_id') && $this->isChanged('message'))
        {
            // statuses are more limited than other posts
            $message = $this->get('message');
            $maxLength = 140;
 
            $message = preg_replace('/\r?\n/', ' ', $message);
 
            if (utf8_strlen($message) > $maxLength)
            {
                $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
            }
 
            $this->set('message', $message);
        }
    }

1500 set it and it works.
But how do I get this back:

sdfsdf.webp
 
Back
Top Bottom