Resolves the problem that discuz 3.4 forced upload avatars cannot be used (always prompts you to upload avatars)

The issue this time is: Mandatory avatar upload has been enabled, even if the avatar is uploaded, it still says that you do not have permission to publish. Please upload the avatar.
The main reason is the communication with uc_derver, which shows successful communication, but this may not be accurate (the reasons are very complex), and the website has enabled HTTPS, so the reason is even more complicated.
The problem lies in obtaining the avatar. In uc_cient/client. php, find
$path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : ''):'/';
Add below:
$matches['port'] = !empty($matches['port'])&&$scheme=='https' ? $matches['port'] : 443;
Then find:
if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
Modify to:
if($port=='443'){$temp = 'ssl://';}else{$temp = 'http://';}if(!$fp = @fsocketopen($temp.($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
At this point, the issue should have been fixed. If it hasn't been fixed yet, try the following methods:
Find in function uc_check_avatar
$res = uc_fopen2($url, 500000, ”, ”, TRUE, UC_IP, 20);
Revise to:
$res = trim(uc_fopen2(UC_API."/avatar.php?uid=$uid&check_file_exists=1"));
The original call was very unstable, sometimes unable to return a value of 1. The new one simply opens the URL and returns a numerical value.
© Website copyright and disclaimer
1.[honmau Media] independently owns the copyright of all materials on relevant pages of this website;
2. No one is allowed to copy it without the express written permission of [honmau Media];
3. The articles that do not indicate "honmau Media" on this website are all from the Internet and are only for everyone to learn and refer;
4. If there is any infringement/violation/irregularity, please contact customer service QQ or email to delete it, please understand;
5.[honmau Media] reserves the right to correct, modify and update this statement at any time.legal notice