本文整理汇总了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;
}
示例2: smartyModifierSanitizeHTML
public function smartyModifierSanitizeHTML($string, $allowedTags = 'editor')
{
return Sanitizer::sanitizeHTML($string, $allowedTags);
}
示例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;
}
示例4: processContent
protected function processContent($value, $key)
{
return Sanitizer::sanitizeHTML($value);
}
示例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;
}