mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +01:00
Truncate Conduit 'clientDescription' so we don't overflow the column
Summary: We store the `arc` commandline in this 255-character column, but it can be more than 255-characters long. If it's huge, truncate it. Test Plan: Executed: arc list --conduit-uri=http://local.aphront.com:8080/ --conduit-version 6.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Works fine after this patch. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D8327
This commit is contained in:
parent
f0e6dc1221
commit
72a062d802
1 changed files with 3 additions and 0 deletions
|
@ -61,6 +61,9 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod {
|
||||||
$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.
|
||||||
|
// See T3307.
|
||||||
|
$client_description = phutil_utf8_shorten($client_description, 255);
|
||||||
$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.
|
||||||
|
|
Loading…
Reference in a new issue