Skip to content

kosync: Make sure there are no leading or trailing whitespaces.#13077

Merged
Frenzie merged 4 commits into
koreader:masterfrom
beedaddy:fix_check_ws
Jan 17, 2025
Merged

kosync: Make sure there are no leading or trailing whitespaces.#13077
Frenzie merged 4 commits into
koreader:masterfrom
beedaddy:fix_check_ws

Conversation

@beedaddy

@beedaddy beedaddy commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

This should fix #13076 (if desired).

As said in the issue, one disadvantage is that existing (in my opinion incorrect) user names would become invalid.
(Another one is that since validate() is also used for passwords, it won't be possible to have whitespaces in passwords.)


This change is Reviewable

@Frenzie

Frenzie commented Jan 16, 2025

Copy link
Copy Markdown
Member

I think it should either be trimmed automatically or give a better error message than "invalid username".

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to add a new trim function, otherwise lgtm 👍

Comment thread plugins/kosync.koplugin/main.lua Outdated
Comment thread plugins/kosync.koplugin/main.lua Outdated
Comment thread plugins/kosync.koplugin/main.lua Outdated
@Frenzie Frenzie added this to the 2025.01 milestone Jan 16, 2025
@Frenzie Frenzie added the Plugin label Jan 16, 2025
Of course we use the existing trim function.

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
@Frenzie Frenzie merged commit 84eb04e into koreader:master Jan 17, 2025
Commodore64user pushed a commit to Commodore64user/KOReader_fork that referenced this pull request Jan 27, 2025
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kosync: usernames and whitespaces

2 participants