Differential D12136 Diff 29178 src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $e_name = pht('Required'); | $e_name = pht('Required'); | ||||
| $errors[] = pht('Name is required.'); | $errors[] = pht('Name is required.'); | ||||
| } else if (preg_match('/[ ,]/', $list->getName())) { | } else if (preg_match('/[ ,]/', $list->getName())) { | ||||
| $e_name = pht('Invalid'); | $e_name = pht('Invalid'); | ||||
| $errors[] = pht('Name must not contain spaces or commas.'); | $errors[] = pht('Name must not contain spaces or commas.'); | ||||
| } | } | ||||
| if ($list->getURI()) { | if ($list->getURI()) { | ||||
| if (!PhabricatorEnv::isValidWebResource($list->getURI())) { | if (!PhabricatorEnv::isValidRemoteURIForLink($list->getURI())) { | ||||
| $e_uri = pht('Invalid'); | $e_uri = pht('Invalid'); | ||||
| $errors[] = pht('Mailing list URI must point to a valid web page.'); | $errors[] = pht('Mailing list URI must point to a valid web page.'); | ||||
| } | } | ||||
| } | } | ||||
| if (!$errors) { | if (!$errors) { | ||||
| try { | try { | ||||
| $list->save(); | $list->save(); | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||