Page MenuHomePhabricator

D18603.id44668.diff
No OneTemporary

D18603.id44668.diff

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

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)

Event Timeline