Skip to content

[Notifier] Use mb_strlen() to check the length limit #39575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

@chalasr
Copy link
Member

chalasr commented Dec 19, 2020

This should apply on DiscordTransport as well?

@nicolas-grekas
Copy link
Member Author

This should apply on DiscordTransport as well?

yes, in 5.2 with #39576

@@ -25,7 +25,7 @@ final class SlackHeaderBlock extends AbstractSlackBlock

public function __construct(string $text)
{
if (\strlen($text) > self::TEXT_LIMIT) {
if (mb_strlen($text, 'UTF-8') > self::TEXT_LIMIT) {
Copy link
Member

@jderusse jderusse Dec 19, 2020

Choose a reason for hiding this comment

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

@nicolas-grekas
Copy link
Member Author

I thought slack counts in bytes => #39410 (files)

thanks for the link, I missed this reply!

@nicolas-grekas nicolas-grekas deleted the n-slack-len branch December 22, 2020 17:19
@nicolas-grekas nicolas-grekas restored the n-slack-len branch December 22, 2020 17:21
@nicolas-grekas nicolas-grekas deleted the n-slack-len branch December 22, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants