nextcloud / nextcloud/password_policy

LengthValidator should use mb_strlen instead of strlen

Open Beginner friendly
#917 0 comments 0 reactions 0 assignees View on GitHub

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:

https://github.com/nextcloud/password_policy/blob/04ed1480044aeadf0f4be5b78868ff57b8f0e063/lib/Validator/LengthValidator.php#L26

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.