Skip to content

Conversation

@DigitalTimK
Copy link
Contributor

@DigitalTimK DigitalTimK commented May 8, 2024

This PR will

curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-type: ' . $contentType,
'Content-length: ' . strlen($payload),
'Content-length: ' . mb_strlen($payload),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we will have to tackle this down once for all.
Can we get some inspiration from this repository https://github.com/kubawerlos/php-cs-fixer-custom-fixers and create a special custom fixer for this line?

It should be doable with something like this in the custom fixer class.

public function fix(\SplFileInfo $file, Tokens $tokens)
{
    // Replace the line 'Content-length: ' . strlen($payload), with 'Content-length: ' . mb_strlen($payload),
    foreach ($tokens as $index => $token) {
        if ($token->isGivenKind(T_CONSTANT_ENCAPSED_STRING) && $token->getContent() === "'Content-length: ' . strlen(\$payload),") {
            $tokens[$index] = new Token([T_CONSTANT_ENCAPSED_STRING, "'Content-length: ' . mb_strlen(\$payload),"]);
        }
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@GhaziTriki GhaziTriki merged commit d87989a into bigbluebutton:develop May 10, 2024
@GhaziTriki GhaziTriki added this to the 3.0.0 milestone May 10, 2024
@DigitalTimK DigitalTimK deleted the feature/captainHook branch May 10, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants