MDL-28936 fix invalid >200 comparison and utf-8 incompatibility

Credit for discovery goes to Jason Ilicic.
This commit is contained in:
Petr Skoda 2011-08-19 18:42:49 +02:00
parent 4f3632441a
commit 0b92cdce1f

View File

@ -9368,9 +9368,10 @@ WHERE m.useridto = :userid AND p.name='popup'";
$smallmessage = null;
if (!empty($message_users->smallmessage)) {
//display the first 200 chars of the message in the popup
$textlib = textlib_get_instance();
$smallmessage = null;
if (strlen($message_users->smallmessage>200)) {
$smallmessage = substr($message_users->smallmessage,0,200).'...';
if ($textlib->strlen($message_users->smallmessage) > 200) {
$smallmessage = $textlib->substr($message_users->smallmessage,0,200).'...';
} else {
$smallmessage = $message_users->smallmessage;
}