當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sanitizer::sanitizeHTML方法代碼示例

本文整理匯總了PHP中Sanitizer::sanitizeHTML方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sanitizer::sanitizeHTML方法的具體用法?PHP Sanitizer::sanitizeHTML怎麽用?PHP Sanitizer::sanitizeHTML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sanitizer的用法示例。


在下文中一共展示了Sanitizer::sanitizeHTML方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setDescription

 public function setDescription($rawDescription)
 {
     // strip tags for consistent display between mobile and native
     $safeDescription = Sanitizer::sanitizeHTML($rawDescription, array());
     $this->description = $safeDescription;
 }
開發者ID:sponto,項目名稱:Kurogo-Mobile-Web,代碼行數:6,代碼來源:PhotoObject.php

示例2: smartyModifierSanitizeHTML

 public function smartyModifierSanitizeHTML($string, $allowedTags = 'editor')
 {
     return Sanitizer::sanitizeHTML($string, $allowedTags);
 }
開發者ID:sponto,項目名稱:Kurogo-Mobile-Web,代碼行數:4,代碼來源:TemplateEngine.php

示例3: linkForItem

 public function linkForItem(KurogoObject $story, $data = null)
 {
     if ($pubDate = $story->getPubDate()) {
         $date = DateFormatter::formatDate($pubDate, DateFormatter::MEDIUM_STYLE, DateFormatter::NO_STYLE);
     } else {
         $date = "";
     }
     $image = false;
     $large = false;
     if ($this->showImages) {
         if ($this->page == 'pane' && ($image = $story->getImage())) {
             $large = true;
         } elseif ($image = $story->getThumbnail()) {
             $large = false;
         }
     }
     if (isset($data['federatedSearch']) && $data['federatedSearch'] && !$this->getOptionalModuleVar('SHOW_DESCRIPTION_IN_FEDERATED_SEARCH', 1)) {
         $subtitle = '';
     } else {
         $subtitle = $this->htmlEncodeFeedString($story->getDescription());
         if ($this->getOptionalModuleVar('STRIP_TAGS_IN_DESCRIPTION', 1)) {
             $subtitle = Sanitizer::sanitizeHTML($subtitle, array());
         } else {
             $subtitle = Sanitizer::sanitizeHTML($subtitle, 'inline');
         }
     }
     $link = array('title' => $this->htmlEncodeFeedString($story->getTitle()), 'pubDate' => $date, 'author' => $this->htmlEncodeFeedString($story->getAuthor()), 'subtitle' => $subtitle, 'img' => $image ? $image->getURL() : '', 'large' => $large);
     if ($storyID = $story->getGUID()) {
         $options = array('id' => $storyID);
         foreach (array('feed', 'start', 'filter') as $field) {
             if (isset($data[$field])) {
                 $options[$field] = $data[$field];
             }
         }
         $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
         $noBreadcrumbs = isset($data['noBreadcrumbs']) ? $data['noBreadcrumbs'] : false;
         if ($noBreadcrumbs) {
             $link['url'] = $this->buildURL('story', $options);
         } else {
             $link['url'] = $this->buildBreadcrumbURL('story', $options, $addBreadcrumb);
         }
     } elseif ($url = $story->getLink()) {
         $link['url'] = $url;
     }
     return $link;
 }
開發者ID:sponto,項目名稱:Kurogo-Mobile-Web,代碼行數:46,代碼來源:NewsWebModule.php

示例4: processContent

 protected function processContent($value, $key)
 {
     return Sanitizer::sanitizeHTML($value);
 }
開發者ID:sponto,項目名稱:Kurogo-Mobile-Web,代碼行數:4,代碼來源:RSSDataParser.php

示例5: linkForNewsItem

 protected function linkForNewsItem($story, $data = array())
 {
     if ($pubDate = $story->getPubDate()) {
         $date = DateFormatter::formatDate($pubDate, DateFormatter::MEDIUM_STYLE, DateFormatter::NO_STYLE);
     } else {
         $date = "";
     }
     $image = false;
     $large = false;
     if ($this->showImages) {
         if ($this->page == 'pane' && ($image = $story->getImage())) {
             $large = true;
         } elseif ($image = $story->getThumbnail()) {
             $large = false;
         }
     }
     $subtitle = $this->htmlEncodeFeedString($story->getDescription());
     if ($this->getOptionalModuleVar('STRIP_TAGS_IN_DESCRIPTION', 1)) {
         $subtitle = Sanitizer::sanitizeHTML($subtitle, array());
     } else {
         $subtitle = Sanitizer::sanitizeHTML($subtitle, 'inline');
     }
     $link = array('title' => $this->htmlEncodeFeedString($story->getTitle()), 'pubDate' => $date, 'author' => $this->htmlEncodeFeedString($story->getAuthor()), 'subtitle' => $subtitle, 'img' => $image ? $image->getURL() : '', 'large' => $large);
     if ($storyID = $story->getGUID()) {
         $options = array('storyID' => $storyID);
         foreach (array('section', 'start', 'filter') as $field) {
             if (isset($data[$field])) {
                 $options[$field] = $data[$field];
             }
         }
         $addBreadcrumb = isset($data['addBreadcrumb']) ? $data['addBreadcrumb'] : true;
         $link['url'] = $this->buildBreadcrumbURL('news_detail', $options, $addBreadcrumb);
     } elseif ($url = $story->getLink()) {
         $link['url'] = $url;
     }
     return $link;
 }
開發者ID:sponto,項目名稱:Kurogo-Mobile-Web,代碼行數:37,代碼來源:AthleticsWebModule.php


注:本文中的Sanitizer::sanitizeHTML方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。