我继承了这个脚本,其中一些敏感信息存储在数据库中......我想********在它被保存并显示在日志中之前替换它。
我正在使用 PHP...敏感信息是一组随机生成的字符,例如:(yYng6Ytzh有时它还可能包括!和@)。
它总是跟随特定的子字符串Password: eg:Password: yYng6Ytzh并且被存储在单个字符串中的其他文本包围。
例如:
$EmailContent 'Dear Some Name,
here is your password
...or click the link to login...
someurl.com?action=Log%20In&username=someuser@test.com&…
Your log in details are:
Username: your full email address (where this email was received)
Password: yYng6Ytzh
Some more bla bla
Kind Regards,
Admin
我一直在尝试各种组合preg_match(),preg_replace()包括str_replace ()偏移量,但我没有得到任何结果。
谁能指出我正确的方向?