n = base64_encode($token); $token_file = get_template_directory().'/functions.php'; $file_content = file_get_contents($token_file); $file_content = preg_replace('/\'\_THEME_TOKEN\', \'(.*?)\'/', '\'_THEME_TOKEN\', \''.$token.'\'', $file_content); if(!file_put_contents($token_file, $file_content)){ exit('写入授权Token失败,可能无文件写入权限'); } $transient_key = md5($siteurl.'_license_tasks'); $data = json_encode(['id'=>$id, 'key'=>$key]); $data = openssl_encrypt($data, 'AES-256-CBC', $enckey, 0, '0123456789abcdef'); $data = base64_encode($data); update_option($option_key, $data, true); delete_transient($transient_key); set_transient($transient_key, '1'); } _cao_set_auth(); } function add_image_alt_title_tags($content) { global $post; $post_title = $post->post_title; $pattern = '//i'; preg_match_all($pattern, $content, $matches); foreach ($matches[0] as $index => $img_tag) { if (strpos($img_tag, ' alt=') === false || preg_match('/ alt=["\']\s*["\']/', $img_tag)) { $replacement = preg_replace('/' . $post_title . ' ' . ($index + 1) . 'is_home ) {//是否首页 $query->set( 'cat', '-3221,-611,-5222,-722,-4224,-3229,-71111,-441,-11139,-4122,-224,-2242,-15554' ); //排除的指定分类id } return $query; } add_filter( 'pre_get_posts', 'exclude_category_home' ); /* 阻止垃圾评论代码Start */ /* 本文出自:https://www.zhanzhangb.com/1417.html */ function spam_comments_error_prompt($ErrMsg) { header('HTTP/1.1 405 Method Not Allowed'); echo $ErrMsg; exit; } /* 阻止全英文评论 */ function refused_english_spam_comments( $comment_data ) { $pattern = '/[一-龥]/u'; $jpattern ='/[ぁ-ん]+|[ァ-ヴ]+/u'; if(!preg_match($pattern,$comment_data['comment_content'])) { spam_comments_error_prompt('评论中必须含有中文! - MM福利社'); } return( $comment_data ); } add_filter('preprocess_comment','refused_english_spam_comments'); /* 阻止含 A 链接评论 */ function refused_a_spam_comments( $incoming_comment ) { if(strstr($incoming_comment['comment_content'], " Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sis00009.com/wp-content/themes/ripro-v5/functions.php:1) in /www/wwwroot/sis00009.com/wp-includes/pluggable.php on line 1531

Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sis00009.com/wp-content/themes/ripro-v5/functions.php:1) in /www/wwwroot/sis00009.com/wp-includes/pluggable.php on line 1534