本文整理汇总了PHP中UTIL_HtmlTag::sanitize方法的典型用法代码示例。如果您正苦于以下问题:PHP UTIL_HtmlTag::sanitize方法的具体用法?PHP UTIL_HtmlTag::sanitize怎么用?PHP UTIL_HtmlTag::sanitize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTIL_HtmlTag
的用法示例。
在下文中一共展示了UTIL_HtmlTag::sanitize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processSettingList
public static function processSettingList($settings, $place, $isAdmin)
{
if ($place != BOL_ComponentService::PLACE_DASHBOARD && !OW::getUser()->isAdmin()) {
$settings['content'] = UTIL_HtmlTag::stripJs($settings['content']);
//$settings['content'] = UTIL_HtmlTag::stripTags($settings['content'], array('frame'), array(), true, true);
} else {
$settings['content'] = UTIL_HtmlTag::sanitize($settings['content']);
}
return parent::processSettingList($settings, $place, $isAdmin);
}
示例2: process
public function process($ctrl)
{
OW::getCacheManager()->clean(array(PostDao::CACHE_TAG_POST_COUNT));
$service = PostService::getInstance();
/* @var $postDao PostService */
$data = $this->getValues();
$data['title'] = UTIL_HtmlTag::stripJs($data['title']);
$postIsNotPublished = $this->post->getStatus() == 2;
$text = UTIL_HtmlTag::sanitize($data['post']);
/* @var $post Post */
$this->post->setTitle($data['title']);
$this->post->setPost($text);
$this->post->setIsDraft($_POST['command'] == 'draft');
$isCreate = empty($this->post->id);
if ($isCreate) {
$this->post->setTimestamp(time());
//Required to make #698 and #822 work together
if ($_POST['command'] == 'draft') {
$this->post->setIsDraft(2);
}
BOL_AuthorizationService::getInstance()->trackAction('blogs', 'add_blog');
} else {
//If post is not new and saved as draft, remove their item from newsfeed
if ($_POST['command'] == 'draft') {
OW::getEventManager()->trigger(new OW_Event('feed.delete_item', array('entityType' => 'blog-post', 'entityId' => $this->post->id)));
} else {
if ($postIsNotPublished) {
// Update timestamp if post was published for the first time
$this->post->setTimestamp(time());
}
}
}
$service->save($this->post);
$tags = array();
if (intval($this->post->getId()) > 0) {
$tags = $data['tf'];
foreach ($tags as $id => $tag) {
$tags[$id] = UTIL_HtmlTag::stripTags($tag);
}
}
$tagService = BOL_TagService::getInstance();
$tagService->updateEntityTags($this->post->getId(), 'blog-post', $tags);
if ($this->post->isDraft()) {
$tagService->setEntityStatus('blog-post', $this->post->getId(), false);
if ($isCreate) {
OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'create_draft_success_msg'));
} else {
OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'edit_draft_success_msg'));
}
} else {
$tagService->setEntityStatus('blog-post', $this->post->getId(), true);
//Newsfeed
$event = new OW_Event('feed.action', array('pluginKey' => 'blogs', 'entityType' => 'blog-post', 'entityId' => $this->post->getId(), 'userId' => $this->post->getAuthorId()));
OW::getEventManager()->trigger($event);
if ($isCreate) {
OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'create_success_msg'));
OW::getEventManager()->trigger(new OW_Event(PostService::EVENT_AFTER_ADD, array('postId' => $this->post->getId())));
} else {
OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'edit_success_msg'));
OW::getEventManager()->trigger(new OW_Event(PostService::EVENT_AFTER_EDIT, array('postId' => $this->post->getId())));
}
$ctrl->redirect(OW::getRouter()->urlForRoute('post', array('id' => $this->post->getId())));
}
}