Skip to content

Comments

New lines are illegal in --serverinfo values#1803

Closed
pljones wants to merge 1 commit intojamulussoftware:masterfrom
pljones:bugfix/avoid-newlines-in-serverinfo
Closed

New lines are illegal in --serverinfo values#1803
pljones wants to merge 1 commit intojamulussoftware:masterfrom
pljones:bugfix/avoid-newlines-in-serverinfo

Conversation

@pljones
Copy link
Collaborator

@pljones pljones commented Jun 1, 2021

Required for #1799.

@pljones pljones force-pushed the bugfix/avoid-newlines-in-serverinfo branch from 7236d38 to a7bb996 Compare June 3, 2021 07:34
@pljones pljones self-assigned this Jun 3, 2021
@pljones pljones requested review from a team, ann0see and softins June 3, 2021 19:29
{
// [this server name]
ThisServerListEntry.strName = slServInfoSeparateParams[0].left ( MAX_LEN_SERVER_NAME );
ThisServerListEntry.strName = slServInfoSeparateParams[0].remove ( reIllegal ).left ( MAX_LEN_SERVER_NAME );
Copy link
Member

Choose a reason for hiding this comment

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

Just removing \n automatically without warning the user might cause confusion. I'd give a warning on stderr and strip the new line afterwards.

Copy link
Collaborator Author

@pljones pljones Jun 5, 2021

Choose a reason for hiding this comment

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

It can go on the Wiki. It's quite difficult to get a new line into the string in the first place - I doubt people are going to use it.

You could argue truncating the server name is surprising people, and that's more commonly hit.

Copy link
Member

@ann0see ann0see Jun 5, 2021

Choose a reason for hiding this comment

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

Hmm yes that’s probably more common. Can you open an issue on the website repo to document this change (new line)? Probably that’s something for @gilgongo s Server manual.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@pljones pljones force-pushed the bugfix/avoid-newlines-in-serverinfo branch from 57b5845 to bf1a3e5 Compare June 7, 2021 07:37
@gilgongo
Copy link
Member

BTW I've added this to the new Server Admin Manual. PR-ing shortly.

@pljones
Copy link
Collaborator Author

pljones commented Jun 12, 2021

Going with a different approach here, so this is no longer needed.

@pljones pljones closed this Jun 12, 2021
@pljones pljones deleted the bugfix/avoid-newlines-in-serverinfo branch June 12, 2021 22:09
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.

3 participants