Skip to content

Commit

Permalink
MDL-28936 fix invalid >200 comparison and utf-8 incompatibility
Browse files Browse the repository at this point in the history
Credit for discovery goes to Jason Ilicic.
  • Loading branch information
skodak committed Aug 19, 2011
1 parent 4f36324 commit 0b92cdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -9368,9 +9368,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;
}
Expand Down

0 comments on commit 0b92cdc

Please sign in to comment.