Ref T8992, Validate alias text field length.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T8992: Actually implement an `alias` field on Phurl URL's
- Commits
- Restricted Diffusion Commit
rP5c6d2be18f59: Helper method for max text field length and validate alias length
Create Phurl with alias of more than 64 characters. Get error. Reduce length of alias to successfully save Phurl.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
One possible issue?
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php | ||
---|---|---|
2209 | If there are no transactions, I think this might fatal -- last($xactions) will return null or false and then have ->getNewValue() called on it? You could probably test this by subscribing/unsubscribing from a Phurl -- I think it will fatal here (maybe). |
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php | ||
---|---|---|
2209 | The way I used this helper, I guess it's called only once you've been bucketed into a switch case of a certain transaction type, so I think there will always be a xaction the way it is now, so I don't think it will fatal as is. But I guess there's no guarantee that's how the method will be used. I'll move the variable back down to after the first if. |
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php | ||
---|---|---|
2213 | I think we can still get here with empty $xactions if the current field value is too long and we aren't touching it. This is impossible to reach in the UI, and probably impossible to reach period (there's no way to make the current field value too long because the database only stores 64 characters) but might be possible for future callers to reach it some day. |