Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15393111
D20727.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20727.diff
View Options
diff --git a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
@@ -119,8 +119,11 @@
break;
}
+ $source_path = $request->getValue('sourcePath');
+ $source_path = $this->normalizeSourcePath($source_path);
+
$diff_data_dict = array(
- 'sourcePath' => $request->getValue('sourcePath'),
+ 'sourcePath' => $source_path,
'sourceMachine' => $request->getValue('sourceMachine'),
'branch' => $request->getValue('branch'),
'creationMethod' => $request->getValue('creationMethod'),
@@ -158,4 +161,18 @@
);
}
+ private function normalizeSourcePath($source_path) {
+ // See T13385. This property is probably headed for deletion. Until we get
+ // there, stop errors arising from running "arc diff" in a working copy
+ // with too many characters.
+
+ $max_size = id(new DifferentialDiff())
+ ->getColumnMaximumByteLength('sourcePath');
+
+ return id(new PhutilUTF8StringTruncator())
+ ->setMaximumBytes($max_size)
+ ->setTerminator('')
+ ->truncateString($source_path);
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 7:44 PM (6 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707588
Default Alt Text
D20727.diff (1 KB)
Attached To
Mode
D20727: When a client submits an overlong "sourcePath", truncate it and continue
Attached
Detach File
Event Timeline
Log In to Comment