diff --git a/src/error/PhutilOpaqueEnvelope.php b/src/error/PhutilOpaqueEnvelope.php --- a/src/error/PhutilOpaqueEnvelope.php +++ b/src/error/PhutilOpaqueEnvelope.php @@ -60,11 +60,13 @@ */ private function mask($string, $noise) { $result = ''; - for ($ii = 0; $ii < strlen($string); $ii++) { - $s = $string[$ii]; - $n = $noise[$ii % strlen($noise)]; + if (phutil_nonempty_string($string)) { + for ($ii = 0; $ii < strlen($string); $ii++) { + $s = $string[$ii]; + $n = $noise[$ii % strlen($noise)]; - $result .= chr(ord($s) ^ ord($n)); + $result .= chr(ord($s) ^ ord($n)); + } } return $result; }