HEX
Server: nginx/1.17.3
System: Linux iZuf67blrqducrakhrvgozZ 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64
User: root (0)
PHP: 7.3.19
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/shenzhouhuazhang.com/wp-content/plugins/wp-seo-tdk/seo-functions.php
<?php



// 准备好一个字符串处理函数

function seo_clear_code($string) {

	if(!$string)

		return '';

	$string = str_replace("\r\n",' ',$string);//清除换行符

	$string = str_replace("\n",' ',$string);//清除换行符

	$string = str_replace("\t",' ',$string);//清除制表符

	$pattern = array("/> *([^ ]*) *</","/[\s]+/","/<!--[^!]*-->/","/\" /","/ \"/","'/\*[^*]*\*/'","/\[(.*)\]/");

	$replace = array(">\\1<"," ","","\"","\"","","");

	return preg_replace($pattern,$replace,$string);

}



function seo_quota_encode($value) {

	$value = str_replace('"','&#34;',$value);

	$value = str_replace("'",'&#39;',$value);

	return $value;

}



function seo_strimwidth($str ,$start , $width ,$trimmarker ){

	if(function_exists('mb_strimwidth'))

	{

		return mb_strimwidth( $str ,$start , $width ,$trimmarker );

	}

	else

	{

		$output = preg_replace('/^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$start.'}((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$width.'}).*/s','\1',$str);

		return $output.$trimmarker;

	}

}



function seo_get($key) {

	$value = get_option('seo_'.$key);

	$value = stripslashes($value);

	return $value;

}



function seo_set($key,$value) {

	$value = strip_tags($value);

	$value = seo_clear_code($value);

	update_option('seo_'.$key,$value) OR add_option('seo_'.$key,$value);

}



function seo_get_post_meta($post_id,$key) {

	$value = get_post_meta($post_id,$key,true);

	$value = stripslashes($value);

	return $value;

}

function seo_get_term_meta($term_id,$key) {

	$value = get_term_meta($term_id,$key,true);

	$value = stripslashes($value);

	return $value;

}

function seo_get_meta($id,$key,$type = 'post') {

	$function = 'seo_get_'.$type.'_meta';

	if(function_exists($function)) {

		return $function($id,$key);

	}

	else {

		return '';

	}

}



function seo_get_category_parents($term_id) {

	$chain = _seo_get_category_parents($term_id);

	if($chain)

	{

		$chain = substr($chain,0,-1);

	}

	return $chain;

}

function _seo_get_category_parents( $term_id, $separator = ',', $visited = array()) {

	$chain = '';

	$term = get_term( $term_id, 'category' );

	if ( is_wp_error( $term ) )

		return $term;



	if ( $term->parent && ( $term->parent != $term->term_id ) && !in_array( $term->parent, $visited ) ) {

		$visited[] = $term->parent;

		$chain .= _seo_get_category_parents( $term->parent, $separator, $visited );

	}



	$chain .= $chain.$separator;



	return $chain;

}