Changeset View
Changeset View
Standalone View
Standalone View
src/xsprintf/csprintf.php
Context not available. | |||||
*/ | */ | ||||
function xsprintf_command($userdata, &$pattern, &$pos, &$value, &$length) { | function xsprintf_command($userdata, &$pattern, &$pos, &$value, &$length) { | ||||
$type = $pattern[$pos]; | $type = $pattern[$pos]; | ||||
$next = (strlen($pattern) > $pos + 1) ? $pattern[$pos + 1] : null; | $next = (@strlen($pattern) > $pos + 1) ? $pattern[$pos + 1] : null; | ||||
$is_unmasked = !empty($userdata['unmasked']); | $is_unmasked = !empty($userdata['unmasked']); | ||||
Context not available. | |||||
case 'L': | case 'L': | ||||
// Remove the L. | // Remove the L. | ||||
$pattern = substr_replace($pattern, '', $pos, 1); | $pattern = substr_replace($pattern, '', $pos, 1); | ||||
$length = strlen($pattern); | $length = @strlen($pattern); | ||||
$type = 's'; | $type = 's'; | ||||
// Check that the value is a non-empty array. | // Check that the value is a non-empty array. | ||||
Context not available. | |||||
break; | break; | ||||
case 'R': | case 'R': | ||||
if (!preg_match('(^[a-zA-Z0-9:/@._+-]+$)', $value)) { | if (!@preg_match('(^[a-zA-Z0-9:/@._+-]+$)', $value)) { | ||||
$value = PhutilCommandString::escapeArgument($value, $mode); | $value = PhutilCommandString::escapeArgument($value, $mode); | ||||
} | } | ||||
$type = 's'; | $type = 's'; | ||||
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