Changeset View
Changeset View
Standalone View
Standalone View
src/filesystem/PhutilDeferredLog.php
| Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | private function format() { | ||||
| $map = array('%' => '%') + $this->data; | $map = array('%' => '%') + $this->data; | ||||
| $result = ''; | $result = ''; | ||||
| $saw_percent = false; | $saw_percent = false; | ||||
| foreach (phutil_utf8v($this->format) as $c) { | foreach (phutil_utf8v($this->format) as $c) { | ||||
| if ($saw_percent) { | if ($saw_percent) { | ||||
| $saw_percent = false; | $saw_percent = false; | ||||
| if (array_key_exists($c, $map)) { | if (array_key_exists($c, $map)) { | ||||
| $result .= addcslashes($map[$c], "\0..\37\\\177..\377"); | $result .= phutil_encode_log($map[$c]); | ||||
| } else { | } else { | ||||
| $result .= '-'; | $result .= '-'; | ||||
| } | } | ||||
| } else if ($c == '%') { | } else if ($c == '%') { | ||||
| $saw_percent = true; | $saw_percent = true; | ||||
| } else { | } else { | ||||
| $result .= $c; | $result .= $c; | ||||
| } | } | ||||
| } | } | ||||
| return rtrim($result)."\n"; | return rtrim($result)."\n"; | ||||
| } | } | ||||
| } | } | ||||