opt-natter / discord-mybb-sync

A MyBB Plugin to syncronise MyBB Groups with Discord Roles
MIT License
11 stars 3 forks source link

Warning - [2] 'htmlspecialchars() expects parameter 1 to be string, array given' #28

Closed taylornmount closed 1 year ago

taylornmount commented 2 years ago

Error log for task logs.

Warning - [2] 'htmlspecialchars() expects parameter 1 to be string, array given' - Line: 601 - File: inc/plugins/discord_right_sync.php

TK-3375 commented 1 year ago

I am getting the same error...

Warning - [2] 'htmlspecialchars() expects parameter 1 to be string, array given' - Line: 601 - File: inc/plugins/discord_right_sync.php

MyBB 1.8.30 PHP 7.4.25

Here is the debug :

    TASK discord_right_sync.php line 22 INFO: All roles synced
    discord_right_sync.php line 601 DEBUG: content-encoding=>gzip
    discord_right_sync.php line 601 DEBUG: cf-ray=>74c37e9578acd5ac-CDG
    discord_right_sync.php line 601 DEBUG: server=>cloudflare
    discord_right_sync.php line 601 DEBUG: nel=>{"success_fraction":0,"report_to":"cf-nel","max_age":604800}
    discord_right_sync.php line 601 DEBUG: report-to=>{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Sz3NzLkA0twMum1SpwomPmuAiB1P90wPCv9S0ECz%2F%2FV7aU9QNB9luxrnuqPQR3GcXoBQ174ejrgA1eF0J3lHGpsIrphDSwvgB%2F8oLNVBXoZb5PwboaKDAZve9cOqeWcj"}],"group":"cf-nel","max_age":604800}
    discord_right_sync.php line 601 DEBUG: cf-cache-status=>DYNAMIC
    discord_right_sync.php line 601 DEBUG: alt-svc=>h3=":443"; ma=86400, h3-29=":443"; ma=86400
    discord_right_sync.php line 601 DEBUG: via=>1.1 google
    discord_right_sync.php line 601 DEBUG: x-envoy-upstream-service-time=>76
    discord_right_sync.php line 601 DEBUG: x-ratelimit-reset-after=>10
    discord_right_sync.php line 601 DEBUG: x-ratelimit-reset=>1663435048
    discord_right_sync.php line 601 DEBUG: x-ratelimit-remaining=>9
    discord_right_sync.php line 601 DEBUG: x-ratelimit-limit=>10
    discord_right_sync.php line 601 DEBUG: x-ratelimit-bucket=>c7f060a5d9790cb6f53000110a7b7edf
    discord_right_sync.php line 601 DEBUG: strict-transport-security=>max-age=31536000; includeSubDomains
    discord_right_sync.php line 601 DEBUG: set-cookie=>
    discord_right_sync.php line 601 DEBUG: content-type=>application/json
    discord_right_sync.php line 601 DEBUG: date=>Sat, 17 Sep 2022 17:17:17 GMT
    discord_right_sync.php line 601 DEBUG: 0=>HTTP/2 403
    discord_right_sync.php line 598 DEBUG: for TestUser#1234
    discord_right_sync.php line 586 DEBUG: Update guilds/947861367728275506/members/265579230220255232 HTTP-Response:403
    discord_right_sync.php line 573 INFO: sth has changed
    discord_right_sync.php line 528 DEBUG: Checking groups
    TASK discord_right_sync.php line 19 DEBUG: task_discord_right_sync was called
TK-3375 commented 1 year ago

I commented out line 601 and it seems to be working. My php is basic (and I haven't practiced in years) but I think that line relates to log writting... so the bot still works even if it doesn't log stuff properly I guess.

Would be better if Original Creator looked it up, my solution is less than ideal.

opt-natter commented 1 year ago

replaced the output of indivdiual fiels with one for the whole response (print_r($response,true)) in v0.8