When creating or renaming a project or a task, copy and paste can lead to unwanted whitespace.
Thus strip any whitespace from the beginning and end of the title string by using trim() when running validateTransactions().
Details
Details
- Reviewers
valerio.bozzolan - Group Reviewers
O1: Blessed Committers
- Create and rename projects and tasks with whitespace at the beginning and the end of their names. Confirm that the whitespace gets removed. Get correctly sorted database query search results, don't get notification mail saying Foo added a parent task: Txxxx: Title . anymore which annoys pedants like me.
- Create and rename projects and tasks by setting the title to include whitespace only. Confirm that the error about being empty is shown.
Diff Detail
Diff Detail
- Repository
- rP Phorge
- Branch
- stripTitleWhitespace (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 1616 Build 1616: arc lint + arc unit
Event Timeline
Comment Actions
Thanks. Seems good to me since trim($new) does not receive null so cannot create PHP 8.1 problems, since we already execute strlen($new) and mb_strlen($new) and that was not reporting errors in your updated install
Comment Actions
This needs rework as the logic currently does not properly handle entering a title consisting of whitespace only. (Outcome gets unpleasant afterwards.)
src/applications/project/xaction/PhabricatorProjectNameTransaction.php | ||
---|---|---|
75 | Maybe we can restore line 75 and put early just after line 74 $new_value = trim($new_value); In this way line 76 is triggered on the new length that I guess it's a better message if you write " lol " So it's saved as "lol" without the related error. |