Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15424079
D18603.id44668.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
D18603.id44668.diff
View Options
diff --git a/src/lint/ArcanistLintMessage.php b/src/lint/ArcanistLintMessage.php
--- a/src/lint/ArcanistLintMessage.php
+++ b/src/lint/ArcanistLintMessage.php
@@ -125,6 +125,21 @@
}
public function setName($name) {
+ $maximum_bytes = 255;
+ $actual_bytes = strlen($name);
+
+ if ($actual_bytes > $maximum_bytes) {
+ throw new Exception(
+ pht(
+ 'Parameter ("%s") passed to "%s" when constructing a lint message '.
+ 'must be a string with a maximum length of %s bytes, but is %s '.
+ 'bytes in length.',
+ $name,
+ 'setName()',
+ new PhutilNumber($maximum_bytes),
+ new PhutilNumber($actual_bytes)));
+ }
+
$this->name = $name;
return $this;
}
diff --git a/src/unit/ArcanistUnitTestResult.php b/src/unit/ArcanistUnitTestResult.php
--- a/src/unit/ArcanistUnitTestResult.php
+++ b/src/unit/ArcanistUnitTestResult.php
@@ -30,6 +30,20 @@
}
public function setName($name) {
+ $maximum_bytes = 255;
+ $actual_bytes = strlen($name);
+
+ if ($actual_bytes > $maximum_bytes) {
+ throw new Exception(
+ pht(
+ 'Parameter ("%s") passed to "%s" when constructing a unit test '.
+ 'message must be a string with a maximum length of %s bytes, but '.
+ 'is %s bytes in length.',
+ $name,
+ 'setName()',
+ new PhutilNumber($maximum_bytes),
+ new PhutilNumber($actual_bytes)));
+ }
$this->name = $name;
return $this;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 23, 8:05 PM (1 w, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384048
Default Alt Text
D18603.id44668.diff (1 KB)
Attached To
Mode
D18603: Add explicit limits to unit test/lint error names
Attached
Detach File
Event Timeline
Log In to Comment