diff --git a/MerlinAU.asp b/MerlinAU.asp index ec4b2d66..b4355b2a 100644 --- a/MerlinAU.asp +++ b/MerlinAU.asp @@ -2456,7 +2456,8 @@ function AssignAjaxSetting (keyName, keyValue) try { var decoded = atob(keyValue); - var password = decoded.split(':')[1] || ''; + var separatorIndex = decoded.indexOf(':'); + var password = (separatorIndex >= 0) ? decoded.slice(separatorIndex + 1) : ''; ajax_custom_settings.routerPassword = password; } catch (e) diff --git a/MerlinAU.sh b/MerlinAU.sh index 7a17e739..f1777411 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -5334,7 +5334,10 @@ _GetLoginCredentials_() _UpdateLoginPswdCheckHelper_ InitPWD else loginCredsDEC="$(echo "$loginCredsENC" | openssl base64 -d)" - thePWSDstring="$(echo "$loginCredsDEC" | sed "s/${userName}://")" + case "$loginCredsDEC" in + *:*) thePWSDstring="${loginCredsDEC#*:}" ;; + *) thePWSDstring="" ;; + esac fi oldPWSDstring="$thePWSDstring" newPSWDstring="$thePWSDstring"