当前位置: 首页>>代码示例>>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;未经允许,请勿转载。