|
|
发表于 2018-8-14 11:51:28
|
显示全部楼层
discuz 3.4 开启https了,强制上传头像无法使用(一直提示需要上传头像)的问题
主要原因在于和uc_server的通讯,在uc_server里面显示通讯成功,但这并不一定准确(里面原因非常复杂),而且我enable了https,所以原因更复杂了。
首先,先做uc的https更新:解决discuz上HTTPS后UCENTER出现通讯失败
然后问题就出在了头像获取上,在uc_client/client.php中,找到
path=matches['path'] ? matches[′path′].(matches['query'] ? '?'.$matches['query'] : '') : '/'; 下面增加:
matches[′port′]=!empty(matches['port'])&&scheme==′https′?matches['port'] : 443; 然后找到:
if(!fp=@fsocketopen((ip ? ip:host), port,errno, errstr,timeout)) { 在修改为:
if($port=='443'){
$temp = 'ssl://';
}else{
$temp = 'http://';
}
if(!$fp = @fsocketopen($temp.($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
至此应该修复了该问题了,如果还没修复,尝试以下方法:
在function uc_check_avatar中找到
res=ucfopen2(url, 500000, ”, ”, TRUE, UC_IP, 20); 修改为:
res=trim(ucfopen2(UCAPI."/avatar.php?uid=uid&check_file_exists=1")); 原本的call很不稳定,有时候返回不出1,新的这个直接打开url返回数值。
原文:https://blog.jing.do/6461 |
|