Page MenuHomePhorge

Account registration: Restrict Real Name length
AcceptedPublic

Authored by aklapper on Fri, Nov 29, 14:22.

Details

Summary

Avoid a database exception at user account registration when users enter very long real names by setting a maximum length.
This does not affect existing account data as it is only called in the account registration code.

Fixes T15962

Test Plan

Go to http://phorge.localhost/auth/register/ and enter long values into the "Real Name" field

Diff Detail

Repository
rP Phorge
Branch
T15962 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1634
Build 1634: arc lint + arc unit

Event Timeline

l2dy added inline comments.
src/applications/people/storage/PhabricatorUser.php
557

In function describeValidUsername(), the number is wrapped in new PhutilNumber(). Should they be consistent?

Thanks for catching that! Amend in new PhutilNumber()

sgtm. Thanks :) just that comment

src/applications/people/storage/PhabricatorUser.php
561

We can just return the result of strlen() <= that

Thanks :)

This revision is now accepted and ready to land.Fri, Nov 29, 18:11

Simplify return of validateRealName() as proposed by Valerio