nextcloud / nextcloud/password_policy
LengthValidator should use mb_strlen instead of strlen
Open
Beginner friendly
Nobody has claimed this yet.
0. Needs triage
bug
- Dominant language
- PHP
- Stars
- 39
- Forks
- 27
- Avg merge
- 1h 36m
- Merged PRs (30d)
- 10
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Code:
Sample:
<?php
$a = '12345';
$b = '密码密码';
var_dump(
strlen($a),
strlen($b),
mb_strlen($a),
mb_strlen($b),
);
Output:
int(5)
int(12)
int(5)
int(4)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open lib/Validator/LengthValidator.php at the linked line and inspect how password length is calculated. Verify the behavior against the issue's ASCII and Chinese examples, then confirm that multibyte characters are counted as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- security
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100