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(