Changeset View
Changeset View
Standalone View
Standalone View
src/future/exec/CommandException.php
Context not available. | |||||
} | } | ||||
private function summarize($string) { | private function summarize($string) { | ||||
if (!strlen($string)) { | if (!@strlen($string)) { | ||||
return '(empty)'; | return '(empty)'; | ||||
} | } | ||||
$limit = 1000; | $limit = 1000; | ||||
$len = strlen($string); | $len = @strlen($string); | ||||
if ($len > $limit) { | if ($len > $limit) { | ||||
$cut = $len - $limit; | $cut = $len - $limit; | ||||
$suffix = pht('... (%s more byte(s)) ...', new PhutilNumber($cut)); | $suffix = pht('... (%s more byte(s)) ...', new PhutilNumber($cut)); | ||||
if ($cut > strlen($suffix)) { | if ($cut > @strlen($suffix)) { | ||||
$string = substr($string, 0, $limit).$suffix; | $string = @substr($string, 0, $limit).$suffix; | ||||
} | } | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0