Skip to content

Commit

Permalink
Update message content nl2br
Browse files Browse the repository at this point in the history
  • Loading branch information
Acris committed May 5, 2016
1 parent a4615f3 commit 386616a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Controller/Admin/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function update()
$msg->save();
$result = array('error' => 0, 'message' => '添加新消息成功');
}
$msg->content = mb_substr(htmlspecialchars($msg->content), 0, 20, 'utf-8');
$msg->content = nl2br(mb_substr(htmlspecialchars($msg->content), 0, 500, 'utf-8'));
$msg->pushEndTime = date('Y-m-d H:i:s', $msg->pushEndTime);
$type = "";
switch ($msg->type) {
Expand Down
2 changes: 1 addition & 1 deletion Template/Default/admin/message.htm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h3 class="panel-title"></h3>
<loop variable="$lists" key="$key" value="$msg">
<tr id="msg-{$msg->id}">
<td>#{$msg->id}</td>
<td>{(mb_substr(htmlspecialchars($msg->content),0,20,'utf-8'))}</td>
<td>{(mb_substr(htmlspecialchars($msg->content),0,500,'utf-8'))}</td>
<td>{(date("Y-m-d H:i:s", $msg->pushEndTime))}</td>
<td>
<if condition="$msg->pushUsers == -1">系统消息
Expand Down

0 comments on commit 386616a

Please sign in to comment.