修改gravatar镜像 (#272)

This commit is contained in:
aierlma 2021-07-22 14:49:30 +08:00 committed by GitHub
parent 77722ed4d7
commit 8a46b8545f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ function sakura_scripts()
// } // }
//拦截移动端 //拦截移动端
version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old'; version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old';
$gravatar_url = akina_option('gravatar_proxy') ?: 'secure.gravatar.com/avatar'; $gravatar_url = akina_option('gravatar_proxy') ?: 'dn-qiniu-avatar.qbox.me/avatar';
wp_localize_script('app', 'Poi', array( wp_localize_script('app', 'Poi', array(
'pjax' => akina_option('poi_pjax'), 'pjax' => akina_option('poi_pjax'),
'movies' => $movies, 'movies' => $movies,
@ -611,7 +611,7 @@ function get_link_items()
*/ */
function gravatar_cn($url) function gravatar_cn($url)
{ {
$gravatar_url = array('0.gravatar.com/avatar','1.gravatar.com/avatar','2.gravatar.com/avatar','secure.gravatar.com/avatar'); $gravatar_url = array('dn-qiniu-avatar.qbox.me/avatar','cdn.v2ex.com/gravatar','gravatar.loli.net/avatar','gravatar.zeruns.tech/avatar');
//return str_replace($gravatar_url, 'cn.gravatar.com', $url); //return str_replace($gravatar_url, 'cn.gravatar.com', $url);
//官方服务器近期大陆访问 429建议使用镜像 //官方服务器近期大陆访问 429建议使用镜像
return str_replace( $gravatar_url, akina_option('gravatar_proxy'), $url ); return str_replace( $gravatar_url, akina_option('gravatar_proxy'), $url );