本文整理汇总了PHP中H::sensitive_words方法的典型用法代码示例。如果您正苦于以下问题:PHP H::sensitive_words方法的具体用法?PHP H::sensitive_words怎么用?PHP H::sensitive_words使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类H
的用法示例。
在下文中一共展示了H::sensitive_words方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: topic_info_action
public function topic_info_action()
{
$topic_info = $this->model('topic')->get_topic_by_id($_GET['topic_id']);
$topic_info['type'] = 'topic';
$topic_info['topic_title'] = H::sensitive_words($topic_info['topic_title']);
$topic_info['topic_description'] = strip_tags(cjk_substr($topic_info['topic_description'], 0, 80, 'UTF-8', '...'));
$topic_info['focus_count'] = $topic_info['focus_count'];
if ($this->user_id) {
$topic_info['focus'] = $this->model('topic')->has_focus_topic($this->user_id, $topic_info['topic_id']);
}
$topic_info['topic_pic'] = get_topic_pic_url('mid', $topic_info['topic_pic']);
$topic_info['url'] = get_js_url('/topic/' . $topic_info['url_token']);
H::ajax_json_output($topic_info);
}
示例2: ajax_json_output
/**
* 数组JSON返回
*
* @param $array
*/
public static function ajax_json_output($array)
{
//HTTP::no_cache_header('text/javascript');
echo str_replace(array("\r", "\n", "\t"), '', json_encode(H::sensitive_words($array)));
exit;
}
示例3: output
public static function output($template_filename, $display = true)
{
if (!strstr($template_filename, self::$template_ext)) {
$template_filename .= self::$template_ext;
}
$display_template_filename = 'default/' . $template_filename;
if (self::$in_app) {
if (get_setting('ui_style') != 'default') {
$custom_template_filename = get_setting('ui_style') . '/' . $template_filename;
if (file_exists(self::$template_path . '/' . $custom_template_filename)) {
$display_template_filename = $custom_template_filename;
}
}
self::assign('template_name', get_setting('ui_style'));
if (!self::$view->_meta_keywords) {
self::set_meta('keywords', get_setting('keywords'));
}
if (!self::$view->_meta_description) {
self::set_meta('description', get_setting('description'));
}
} else {
self::assign('template_name', 'default');
}
if (self::$in_app and $display) {
if ($plugins = AWS_APP::plugins()->parse($_GET['app'], $_GET['c'], $_GET['act'], str_replace(self::$template_ext, '', $template_filename))) {
foreach ($plugins as $plugin_file) {
include_once $plugin_file;
}
}
}
$output = self::$view->getOutput($display_template_filename);
if (self::$in_app and basename($template_filename) != 'debuger.tpl.htm') {
$template_dirs = explode('/', $template_filename);
if ($template_dirs[0] != 'admin') {
$output = H::sensitive_words($output);
}
if (get_setting('url_rewrite_enable') != 'Y' or $template_dirs[0] == 'admin') {
$output = preg_replace('/(\\s+href|\\s+action)=([\\"|\'])(?!http)(?!mailto)(?!file)(?!ftp)(?!javascript)(?![\\/|\\#])(?!\\.\\/)([^\\"\']+)([\\"|\'])/is', '\\1=\\2' . base_url() . '/' . G_INDEX_SCRIPT . '\\3\\4', $output);
}
if ($request_routes = get_request_route() and $template_dirs[0] != 'admin' and get_setting('url_rewrite_enable') == 'Y') {
foreach ($request_routes as $key => $val) {
$output = preg_replace("/href=[\"|']" . $val[0] . "[\\#]/", "href=\"" . $val[1] . "#", $output);
$output = preg_replace("/href=[\"|']" . $val[0] . "[\"|']/", "href=\"" . $val[1] . "\"", $output);
}
}
if (get_setting('url_rewrite_enable') == 'Y' and $template_dirs[0] != 'admin') {
$output = preg_replace('/(href|action)=([\\"|\'])(?!mailto)(?!file)(?!ftp)(?!http)(?!javascript)(?![\\/|\\#])(?!\\.\\/)([^\\"\']+)([\\"|\'])/is', '\\1=\\2' . base_url() . '/' . '\\3\\4', $output);
}
//$output = preg_replace("/([a-zA-Z0-9]+_?[a-zA-Z0-9]+)-__|(__[a-zA-Z0-9]+_?[a-zA-Z0-9]+)-$/i", '', $output);
$output = preg_replace('/[a-zA-Z0-9]+_?[a-zA-Z0-9]*\\-__/', '', $output);
$output = preg_replace('/(__)?[a-zA-Z0-9]+_?[a-zA-Z0-9]*\\-([\'|"])/', '\\2', $output);
if (AWS_APP::config()->get('system')->debug) {
$output .= "\r\n<!-- Template End: " . $display_template_filename . " -->\r\n";
}
}
if ($display) {
echo $output;
flush();
} else {
return $output;
}
}