Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F86088
D7656.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
601 B
Referenced Files
None
Subscribers
None
D7656.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7656: Improve the performance of phutil_loggable_string()
Attached
Detach File
Event Timeline
Log In to Comment