diff --git a/daemon.py b/daemon.py index 3879b28f1..377f4267f 100644 --- a/daemon.py +++ b/daemon.py @@ -253,7 +253,7 @@ from utils import replace_users_with_at from utils import local_actor_url from utils import is_float from utils import valid_password -from utils import removeLineEndings +from utils import remove_line_endings from utils import get_base_content_from_post from utils import acct_dir from utils import getImageExtensionFromMimeType @@ -4968,9 +4968,9 @@ class PubServer(BaseHTTPRequestHandler): if fields.get('password') and \ fields.get('passwordconfirm'): fields['password'] = \ - removeLineEndings(fields['password']) + remove_line_endings(fields['password']) fields['passwordconfirm'] = \ - removeLineEndings(fields['passwordconfirm']) + remove_line_endings(fields['passwordconfirm']) if valid_password(fields['password']) and \ fields['password'] == fields['passwordconfirm']: # set password diff --git a/person.py b/person.py index d4c6a44c3..4373c0646 100644 --- a/person.py +++ b/person.py @@ -41,7 +41,7 @@ from media import processMetaData from utils import removeHtml from utils import containsInvalidChars from utils import replace_users_with_at -from utils import removeLineEndings +from utils import remove_line_endings from utils import removeDomainPort from utils import getStatusNumber from utils import get_full_domain @@ -533,7 +533,7 @@ def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int, print('EX: unable to save 2 ' + filename) if password: - password = removeLineEndings(password) + password = remove_line_endings(password) storeBasicCredentials(base_dir, nickname, password) return privateKeyPem, publicKeyPem, newPerson, webfingerEndpoint diff --git a/utils.py b/utils.py index 016a75c6f..36d5bb670 100644 --- a/utils.py +++ b/utils.py @@ -2945,7 +2945,7 @@ def validUrlPrefix(url: str) -> bool: return False -def removeLineEndings(text: str) -> str: +def remove_line_endings(text: str) -> str: """Removes any newline from the end of a string """ text = text.replace('\n', '')