diff --git a/helpers/SynapseHelper.php b/helpers/SynapseHelper.php index 670aad1..7a14dd0 100644 --- a/helpers/SynapseHelper.php +++ b/helpers/SynapseHelper.php @@ -35,7 +35,10 @@ class SynapseHelper { return null; } - $matrixId = '@' . rawurlencode($username) . ':' . $domain; + // Build the Matrix user ID and percent-encode it once for the URL path. + // rawurlencode($username) here would double-encode any special chars when + // the full $matrixId string is encoded again below. + $matrixId = '@' . $username . ':' . $domain; $url = rtrim($baseUrl, '/') . '/_synapse/admin/v2/users/' . rawurlencode($matrixId); $ch = curl_init($url);