1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-08-09 16:01:39 +08:00

优化demo分支过滤私密配置

This commit is contained in:
xiaochong0302 2020-09-22 16:35:19 +08:00
parent 3187f04b35
commit e4bf021203

View File

@ -62,8 +62,9 @@ class Setting extends Service
*/
if ($items->count() > 0) {
foreach ($items as $item) {
$pattern = '/(id|auth|key|secret|pwd|pass)/';
if (preg_match($pattern, $item->item_key)) {
$case1 = preg_match('/(id|auth|key|secret|pass|pwd)/', $item->item_key);
$case2 = $this->dispatcher->getControllerName() == 'setting';
if ($case1 && $case2) {
$item->item_value = '***';
}
$result[$item->item_key] = $item->item_value;