New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text fields should trim blanks #33294
Comments
Agree - I have done similar in other projects. IMO the place to do it is in the backend that receives and processes the API POST/PUT... calls. For the appropriate fields that should not have space at the front or back, then "be nice to the caller" and trim the crap. That way any client (webUI, android, iOS, desktop sync) gets the fields trimmed the same way and automagically. Need to be careful for file/folder name fields - I think it is technically valid to have file names that have a space on the end "abc " and that is a different file to "abc"! So don't go overboard and trim those. |
https://en.wikipedia.org/wiki/Filename#Filename_extensions see
Linux can do that Interesting situation if In case we would restrict creation in core we would be safe on the creation side. |
@mmattel yes, in the desktop client repo there has been a lot of discussion about file-system file-name differences. It always causes hassles for people with files on Windows, Max and *nix with different mixes of file names that are not valid on all platforms. Anyway, for the purposes of this issue, "it is not about trimming file name fields" but about trimming other "general" fields. |
🤦♂️ |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
It would be nice to tidy this sort of thing in various APIs, just to be nice to users. |
As the original author, just a brief comment: Extending the discussion to the complexity of file names is wrong - this has nothing to do with files, but simply with the input of information to OwnCloud itself. Trimming spaces from things like server names is basic good practice, and could be easily addressed. |
Yes, IMO the discussion above ended up clarifying that: "Anyway, for the purposes of this issue, "it is not about trimming file name fields" but about trimming other "general" fields." Anyone can submit a PR to "clean" incoming data. |
This is a lot of work, but quite simple to do, adding junior job label |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Removed the stale label, because this is "a good thing" that could be done some day. |
is this resolved? I'd have liked to work here. |
"Anyone can submit a PR to "clean" incoming data." - this job has not been done. Feel free to make a start. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
dont close |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Unstale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed. |
Text fields should trim blanks. When spaces are accidentally entered (as often happens with copy-paste), if they are not trimmed, the resulting error is very difficult for the user to identify.
This may be a general issue. Here is documentation of a specific instance where it occurs. When setting up the SMTP server, so that OwnCloud can send notifications. If the server address has a leading or trailing space, OwnCloud cannot send email.
Steps to reproduce
Expected behaviour
Spaces should be trimmed from the start and end of all text fields, before the data is used. In this example, the server address should work even with leading or trailing blanks, because those should be deleted before the data is used.
Actual behaviour
Leading or trailing spaces are retained as part of the server address.
Server configuration
Operating system:
Ubuntu 18.04
Web server:
Apache 2.4.29
Database:
MySQL 5.7.24
PHP version:
7.2
ownCloud version: (see ownCloud admin page)
10.0.10.4
Updated from an older ownCloud or fresh install:
Fresh install
Where did you install ownCloud from:
Package manager after adding key
Signing status (ownCloud 9.0 and above):
No errors have been found.
Remaining items omitted as not relevant
The text was updated successfully, but these errors were encountered: