Changeset View
Changeset View
Standalone View
Standalone View
src/utils/utils.php
| Show First 20 Lines • Show All 1,010 Lines • ▼ Show 20 Lines | function phutil_loggable_string($string) { | ||||
| $len = strlen($string); | $len = strlen($string); | ||||
| for ($ii = 0; $ii < $len; $ii++) { | for ($ii = 0; $ii < $len; $ii++) { | ||||
| $c = $string[$ii]; | $c = $string[$ii]; | ||||
| if (isset($c_map[$c])) { | if (isset($c_map[$c])) { | ||||
| $result .= $c_map[$c]; | $result .= $c_map[$c]; | ||||
| } else { | } else { | ||||
| $o = ord($c); | $o = ord($c); | ||||
| if ($o < 0x20 || $o == 0x7F) { | if ($o < 0x20 || $o >= 0x7F) { | ||||
| $result .= '\\x'.sprintf('%02X', $o); | $result .= '\\x'.sprintf('%02X', $o); | ||||
| } else { | } else { | ||||
| $result .= $c; | $result .= $c; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return $result; | return $result; | ||||
| ▲ Show 20 Lines • Show All 941 Lines • Show Last 20 Lines | |||||