解决discuz!x3.4新用户强制上传头像后,无法发帖问题!

[复制链接]
查看2881 | 回复0 | 2020-2-23 16:59 | 显示全部楼层 |阅读模式
首先,先检查贵站转HTTPS后UCENTER会否出现通讯失败,有问题先要修正
然后问题就出在了头像获取上,在uc_client/client.php中,找到
  1. $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/';
复制代码
下面增加:
  1. $matches['port'] = !empty($matches['port'])&&$scheme=='https' ? $matches['port'] : 443;
复制代码
然后找到:
  1. if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
复制代码
修改为:
  1.                if($port=='443'){
  2.                 $temp = 'ssl://';
  3.         }else{
  4.                 $temp = 'http://';
  5.         }
  6.         if(!$fp = @fsocketopen($temp.($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
复制代码
至此应该修复了该问题了,如果还没修复,尝试以下方法:
在function uc_check_avatar中找到
  1. $res = uc_fopen2($url, 500000, ”, ”, TRUE, UC_IP, 20);
复制代码
修改为:
  1. $res = trim(uc_fopen2(UC_API."/avatar.php?uid=$uid&check_file_exists=1"));
复制代码
原本的call很不稳定,有时候返回不出1,新的这个直接打开url返回数值。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16