Legacy UTF in profileblock

Status
Not open for further replies.

motd2

Customer
Test on locallhost

If UTF-8

90E1a4P7t2Y282V4.png


edit file class_profileblock.php
line 710 and below

HTML:
				mb_internal_encoding('utf-8');
				// Get rid of BBCode so we're left with the username and :
				$message = $message_orig = strip_bbcode($results_r['message'], false, false, false);

				if (strtoupper($userinfo['username']))
				{
					$start = $origstart = strpos(strtoupper($message), strtoupper($userinfo['username']));
				}
				else
				{
					$start = $origstart = 0;
				}

				if ($start >= $this->registry->options['dbtech_usertag_postpreview_charlimit'])
				{
					// Get the new start pos
					$prefix = '...';
					$start -= $this->registry->options['dbtech_usertag_postpreview_charlimit'];
				}
				else
				{
					$prefix = '';
					$start = 0;
				}

				$remaining = mb_substr($message, ($origstart + strlen($userinfo['username'] . ':')));

				// - ($this->registry->options['dbtech_usertag_postpreview_charlimit'] * 2)
				if ( mb_strlen($remaining) > $this->registry->options['dbtech_usertag_postpreview_charlimit'])
				{
					// Get the new end pos
					$suffix = '...';
					$end = $this->registry->options['dbtech_usertag_postpreview_charlimit'] - strlen($remaining);
					$message = mb_substr($message, $start, $end);
				}
				else
				{
					$suffix = '';
					$end = 0;
					$message = mb_substr($message, $start);
				}
we get

10x1j4k75222Y296.png


But then it does not work for other encodings.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Status
Not open for further replies.
Back
Top