Page MenuHomePhabricator

D7656.diff

diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -892,6 +892,10 @@
* for printing on a single log line.
*/
function phutil_loggable_string($string) {
+ if (preg_match('/^[\x20-\x7E]+$/', $string)) {
+ return $string;
+ }
+
$result = '';
static $c_map = array(
@@ -901,7 +905,8 @@
"\t" => '\\t',
);
- for ($ii = 0; $ii < strlen($string); $ii++) {
+ $len = strlen($string);
+ for ($ii = 0; $ii < $len; $ii++) {
$c = $string[$ii];
if (isset($c_map[$c])) {
$result .= $c_map[$c];

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/7j/r3/6zwhybr6hgxvo5fz
Default Alt Text
D7656.diff (601 B)

Event Timeline