Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Notifier] [Discord] Use private const and mb_strlen()#39492

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:5.2fromOskarStark:private-const-5.2
Dec 17, 2020

Conversation

@OskarStark
Copy link
Contributor

QA
Branch?5.2
Bug fix?no
New feature?no
Deprecations?no
Tickets---
LicenseMIT
Doc PR---

like proposed by@nicolas-grekas inhttps://github.com/symfony/symfony/pull/39444/files#r542288432

@nicolas-grekas
Copy link
Member

Can you please check how Discord behaves as I wondered in my comment ?

@OskarStark
Copy link
ContributorAuthor

Can you please check how Discord behaves as I wondered in my comment ?

Unfortunately I do not have Discord account I can test with.

@connorhu@mpiot maybe you can help us out here?

{
protectedconstHOST ='discord.com';

privateconstMAX_SUBJECT_LENGTH =2000;

Choose a reason for hiding this comment

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

it's called TEXT_LIMIT in the Slack bridge 5.2
maybe SUBJECT_LIMIT here? or another name in the Slack bridge?

$content =$message->getSubject();

if (\strlen($content) >2000) {
if (mb_strlen($content) >self::MAX_SUBJECT_LENGTH) {

Choose a reason for hiding this comment

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

calling mb_* without an explicit charset is something that should be banned in all situations.
It's a bit like gambling with charsets :)
UTF-8 must be specified here (and only utf8 is supported, since we use json along the path to Discord)

@connorhu
Copy link
Contributor

It seems ok. Should I run some tests with discord api?

@fabpot
Copy link
Member

Thank you@OskarStark.

@fabpotfabpot merged commit6ead4a2 intosymfony:5.2Dec 17, 2020
@OskarStarkOskarStark deleted the private-const-5.2 branchDecember 17, 2020 16:58
@fabpotfabpot mentioned this pull requestDec 18, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

5 participants

@OskarStark@nicolas-grekas@connorhu@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp