mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-26 08:46:28 +08:00
fix: Optimize decryption implementation (#10130)
This commit is contained in:
parent
0a5b13a418
commit
780b6cdec9
2 changed files with 10 additions and 0 deletions
|
|
@ -69,6 +69,11 @@ func StringDecryptWithBase64(text string) (string, error) {
|
|||
}
|
||||
|
||||
func StringDecryptWithKey(text, key string) (string, error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r)
|
||||
}
|
||||
}()
|
||||
if len(text) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ func StringDecrypt(text string) (string, error) {
|
|||
}
|
||||
|
||||
func StringDecryptWithKey(text, key string) (string, error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r)
|
||||
}
|
||||
}()
|
||||
if len(text) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue