コード例 #1
0
ファイル: Html.php プロジェクト: AllenLyu/ko
 public static function S2Html($sIn, $iMaxLength = 0)
 {
     if ($iMaxLength) {
         $sIn = self::S2Text($sIn, $iMaxLength, '...');
         $sIn = Ko_View_Escape::VEscapeHtml($sIn);
         $sIn = Ko_Html_WebParse::sParse($sIn, $iMaxLength, 'UTF-8');
     }
     return $sIn;
 }
コード例 #2
0
ファイル: Text.php プロジェクト: AllenLyu/ko
 public static function S2Html($sIn, $iMaxLength = 0)
 {
     if ($iMaxLength) {
         $sIn = Ko_Tool_Str::SSubStr_UTF8($sIn, $iMaxLength);
     }
     $sIn = Ko_View_Escape::VEscapeHtml($sIn);
     if ($iMaxLength) {
         $sIn = Ko_Html_WebParse::sParse($sIn, $iMaxLength, 'UTF-8');
     }
     return $sIn;
 }
コード例 #3
0
ファイル: Ajax.php プロジェクト: AllenLyu/ko
 protected function vOutputPage()
 {
     $data = array('errno' => intval($this->_iJsonErrno), 'error' => Ko_View_Escape::VEscapeHtml($this->_sJsonError));
     if (!$this->_bNoHtml) {
         $data['html'] = Ko_View_Escape::VEscapeHtml($this->_aJsonData);
     }
     if (!$this->_bNoData) {
         $data['data'] = $this->_aJsonData;
     }
     echo json_encode($data);
 }
コード例 #4
0
ファイル: Smarty.php プロジェクト: AllenLyu/ko
 private function _vEscapeData(array &$data)
 {
     foreach ($data as $k => &$v) {
         if ($v instanceof Ko_View_Render_Base) {
             $v = $v->sRender();
         } else {
             if (is_array($v)) {
                 $this->_vEscapeData($v);
             } else {
                 $v = Ko_View_Escape::VEscapeHtml($v);
             }
         }
     }
     unset($v);
 }