Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15337270
D19564.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
967 B
Referenced Files
None
Subscribers
None
D19564.diff
View Options
diff --git a/src/serviceprofiler/PhutilServiceProfiler.php b/src/serviceprofiler/PhutilServiceProfiler.php
--- a/src/serviceprofiler/PhutilServiceProfiler.php
+++ b/src/serviceprofiler/PhutilServiceProfiler.php
@@ -190,7 +190,24 @@
$mark,
$id,
$type,
- $desc);
+ self::escapeProfilerStringForDisplay($desc));
}
+ private static function escapeProfilerStringForDisplay($string) {
+ // Convert tabs and newlines to spaces and collapse blocks of whitespace,
+ // most often formatting in queries.
+ $string = preg_replace('/\s{2,}/', ' ', $string);
+
+ // Replace sequences of binary characters with printable text. We allow
+ // some printable characters to appear in between unprintable characters
+ // to try to collapse the entire run.
+ $string = preg_replace(
+ '/[\x00-\x1F\x7F-\xFF](.{0,12}[\x00-\x1F\x7F-\xFF])*/',
+ '<...binary data...>',
+ $string);
+
+ return $string;
+ }
+
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 10 2025, 5:05 AM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7401629
Default Alt Text
D19564.diff (967 B)
Attached To
Mode
D19564: Improve "--trace" behavior when output includes binary queries
Attached
Detach File
Event Timeline
Log In to Comment