Skip to content

Conversation

@artonge
Copy link
Contributor

@artonge artonge commented Nov 5, 2025

It does not make sense to allow group name with weird white space sequence going forward.

Same for group ids, in which we do not really want white space.

@artonge artonge requested a review from a team as a code owner November 5, 2025 17:03
@artonge artonge requested review from ArtificialOwl, CarlSchwan, icewind1991 and yemkareems and removed request for a team November 5, 2025 17:03
@artonge artonge self-assigned this Nov 5, 2025
@artonge artonge added enhancement 3. to review Waiting for reviews feature: users and groups php Pull requests that update Php code labels Nov 5, 2025
@artonge artonge added this to the Nextcloud 33 milestone Nov 5, 2025
@artonge artonge force-pushed the artonge/feat/sanitize_groupname branch from fda3b6b to 21b5f96 Compare November 5, 2025 17:06
It does not make sense to allow group name with weird white space sequence going forward.

Same for group ids, in which we do not really want white space.

Signed-off-by: Louis Chmn <[email protected]>
@artonge artonge force-pushed the artonge/feat/sanitize_groupname branch from 21b5f96 to 9890117 Compare November 5, 2025 17:31
return mb_strlen($displayName) > 64
? hash('sha256', $displayName)
: $displayName;
$displayNameWithoutWhitespace = preg_replace('/\s+/', '_', $displayName);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the opportunity to be even more restrictive on the GID sanitation. Should it contain special Unicode characters, quotes, accentuation, emoji?

Copy link
Member

Choose a reason for hiding this comment

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

Just to be clear, this is only for new groups. We still have to support all those other things on already existing groups

@artonge artonge requested a review from nickvergessen November 6, 2025 07:26
@artonge artonge merged commit cddd666 into master Nov 6, 2025
230 of 242 checks passed
@artonge artonge deleted the artonge/feat/sanitize_groupname branch November 6, 2025 14:24
@blizzz
Copy link
Member

blizzz commented Nov 6, 2025

This is a breaking behavioral change. At the very least it must be added to critical changes.

For instance it breaks SAML integration tests, and there might be users who automate group provisioning and may run into it as well.

But I would recommend to revert it. Logic has to be kept in place, foreign backends are not effected. This causes more problems than it solves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement feature: users and groups php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants