Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitConnectConduitAPIMethod.php
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | return array( | ||||
| 'ERR-NO-CERTIFICATE' => 'This server requires authentication.', | 'ERR-NO-CERTIFICATE' => 'This server requires authentication.', | ||||
| ); | ); | ||||
| } | } | ||||
| protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
| $client = $request->getValue('client'); | $client = $request->getValue('client'); | ||||
| $client_version = (int)$request->getValue('clientVersion'); | $client_version = (int)$request->getValue('clientVersion'); | ||||
| $client_description = (string)$request->getValue('clientDescription'); | $client_description = (string)$request->getValue('clientDescription'); | ||||
| // TODO: This should be character-oriented, not display-oriented. | $client_description = id(new PhutilUTF8StringTruncator()) | ||||
| // See T3307. | ->setMaximumCodepoints(255) | ||||
| $client_description = phutil_utf8_shorten($client_description, 255); | ->truncateString($client_description); | ||||
| $username = (string)$request->getValue('user'); | $username = (string)$request->getValue('user'); | ||||
| // Log the connection, regardless of the outcome of checks below. | // Log the connection, regardless of the outcome of checks below. | ||||
| $connection = new PhabricatorConduitConnectionLog(); | $connection = new PhabricatorConduitConnectionLog(); | ||||
| $connection->setClient($client); | $connection->setClient($client); | ||||
| $connection->setClientVersion($client_version); | $connection->setClientVersion($client_version); | ||||
| $connection->setClientDescription($client_description); | $connection->setClientDescription($client_description); | ||||
| $connection->setUsername($username); | $connection->setUsername($username); | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||