Skip to content

Use mb_* string methods to extract first character for generated avatars - #8468

Merged
rullzer merged 1 commit into
masterfrom
fix-unicode-avatars
Feb 21, 2018
Merged

Use mb_* string methods to extract first character for generated avatars#8468
rullzer merged 1 commit into
masterfrom
fix-unicode-avatars

Conversation

@MorrisJobke

Copy link
Copy Markdown
Member

This fixes#8451 where the first character is a non-ASCII character. The $string[0] notation only extracted one byte and thus resulting in an invalid code. The mb_strtoupper method also allows to convert characters independently from the current locale on the server.

See also http://php.net/manual/en/function.mb-strtoupper.php

I would also backport this to 13 and 12 to prevent further reports on this.

This fixes#8451 where the first character is a non-ASCII character. The `$string[0]` notation only extracted one byte and thus resulting in an invalid code. The `mb_strtoupper` method also allows to convert characters independently from the current locale on the server.
See also http://php.net/manual/en/function.mb-strtoupper.php
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@codecov

codecovBot commented Feb 21, 2018

Copy link
Copy Markdown

Codecov Report

Merging #8468 into master will not change coverage.
The diff coverage is 100%.

@@ Coverage Diff @@## master #8468 +/- ##
=========================================
Coverage 51.82% 51.82% Complexity 25363 25363 =========================================
Files 1601 1601 Lines 95018 95018 Branches 1377 1377 =========================================
Hits 49241 49241 Misses 45777 45777
Impacted FilesCoverage ΔComplexity Δ
lib/private/Avatar.php75.49% <100%> (ø)54 <0> (ø)⬇️
apps/files_trashbin/lib/Trashbin.php72.46% <0%> (-0.25%)136% <0%> (ø)
lib/private/Files/Cache/Propagator.php96.2% <0%> (+1.26%)16% <0%> (ø)⬇️

@MorrisJobke

Copy link
Copy Markdown
MemberAuthor

Stable12 not needed because it is done in JS there.

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

Labels

3. to reviewWaiting for reviewspapercutAnnoying recurring UX issue with possibly simple fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avatar replacement character is always à when full name starts with character with diacritic mark

4 participants

@MorrisJobke@rullzer@nickvergessen@juliusknorr