Page MenuHomePhorge

D25835.1746148526.diff
No OneTemporary

D25835.1746148526.diff

diff --git a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
@@ -72,14 +72,16 @@
// problems.
foreach ($xactions as $xaction) {
- $new = $xaction->getNewValue();
- if (!strlen($new)) {
+ $new_value = $xaction->getNewValue();
+ $new_value = trim($new_value); // Strip surrounding whitespace
+ $xaction->setNewValue($new_value);
+ if (!strlen($new_value)) {
$errors[] = $this->newInvalidError(
pht('Tasks must have a title.'),
$xaction);
continue;
}
- if (mb_strlen($new) > $this->maximumTaskTitleLength) {
+ if (mb_strlen($new_value) > $this->maximumTaskTitleLength) {
$errors[] = $this->newInvalidError(
pht('Task title cannot exceed %d characters.',
$this->maximumTaskTitleLength),
diff --git a/src/applications/project/xaction/PhabricatorProjectNameTransaction.php b/src/applications/project/xaction/PhabricatorProjectNameTransaction.php
--- a/src/applications/project/xaction/PhabricatorProjectNameTransaction.php
+++ b/src/applications/project/xaction/PhabricatorProjectNameTransaction.php
@@ -72,6 +72,8 @@
$max_length = $object->getColumnMaximumByteLength('name');
foreach ($xactions as $xaction) {
$new_value = $xaction->getNewValue();
+ $new_value = trim($new_value); // Strip surrounding whitespace
+ $xaction->setNewValue($new_value);
$new_length = strlen($new_value);
if ($new_length > $max_length) {
$errors[] = $this->newInvalidError(

File Metadata

Mime Type
text/plain
Expires
Fri, May 2, 01:15 (11 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1439198
Default Alt Text
D25835.1746148526.diff (1 KB)

Event Timeline