示例#1
0
 /**
  * Парсит текст комментария к работе
  * @param string $sText
  */
 public function parseItemComment($sMessage)
 {
     $sMessage = preg_replace("/(\\<script)(.*?)(script>)/si", '', $sMessage);
     $sMessage = htmlspecialchars($sMessage);
     $sMessage = preg_replace("/(\\<)(.*?)(--\\>)/mi", '' . nl2br("\\2") . '', $sMessage);
     return Func::hrefActivate(nl2br($sMessage));
 }
示例#2
0
 function cleanMessage($sMessage, $nMaxLenght = 4100)
 {
     $sMessage = preg_replace("/(\\<script)(.*?)(script>)/si", '', $sMessage);
     $sMessage = htmlspecialchars($sMessage);
     $sMessage = preg_replace("/(\\<)(.*?)(--\\>)/mi", '' . nl2br("\\2") . '', $sMessage);
     return mb_substr(Func::hrefActivate($sMessage), 0, $nMaxLenght);
 }
示例#3
0
文件: func.php 项目: Sywooch/dobox
 static function cleanComment($text)
 {
     $text = preg_replace("/(\\<script)(.*?)(script>)/si", '', "{$text}");
     $text = strip_tags($text);
     $text = str_replace("<!--", "&lt;!--", $text);
     $text = preg_replace("/(\\<)(.*?)(--\\>)/mi", "" . nl2br("\\2") . "", $text);
     return Func::hrefActivate($text);
 }