Permalink
Browse files

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

Credit for discovery goes to Jason Ilicic.
  • Loading branch information...
1 parent 24654d9 commit a32da065aedc077f27089f9f96f790e51b162672 @skodak skodak committed Aug 19, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/moodlelib.php
View
@@ -9325,9 +9325,10 @@ function message_popup_window() {
$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;
}

0 comments on commit a32da06

Please sign in to comment.