Changeset View
Changeset View
Standalone View
Standalone View
src/utils/utils.php
Show First 20 Lines • Show All 1,340 Lines • ▼ Show 20 Lines | |||||
* output. For example, when `git fetch` fails, the output includes credentials | * output. For example, when `git fetch` fails, the output includes credentials | ||||
* for authenticated HTTP remotes. | * for authenticated HTTP remotes. | ||||
* | * | ||||
* @param string Some block of text. | * @param string Some block of text. | ||||
* @return string A similar block of text, but with credentials that could | * @return string A similar block of text, but with credentials that could | ||||
* be identified censored. | * be identified censored. | ||||
*/ | */ | ||||
function phutil_censor_credentials($string) { | function phutil_censor_credentials($string) { | ||||
return preg_replace(',(?<=://)([^/@\s]+)(?=@|$),', 'xxxxx', $string); | return preg_replace(',(?<=://)([^/@\s]+)(?=@|$),', '********', $string); | ||||
} | } | ||||
/** | /** | ||||
* Returns a parsable string representation of a variable. | * Returns a parsable string representation of a variable. | ||||
* | * | ||||
* This function is intended to behave similarly to PHP's `var_export` function, | * This function is intended to behave similarly to PHP's `var_export` function, | ||||
* but the output is intended to follow our style conventions. | * but the output is intended to follow our style conventions. | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |