Closed brad-richards closed 1 year ago
GitMate.io thinks possibly related issues are https://github.com/owncloud/core/issues/12174 (blank screen), https://github.com/owncloud/core/issues/3569 (Blank screen), https://github.com/owncloud/core/issues/15176 (Confirm function for text fields), https://github.com/owncloud/core/issues/6113 (Creating a new text file resulting in blank text), and https://github.com/owncloud/core/issues/18820 (Asterisks Fill Blank Password Field in IE8).
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 Comparison of filename limitations NTFS (eg mounted via SMB)
The Win32 API strips trailing space and period (full-stop) characters from filenames,
except when UNC paths are used.
Linux can do that Windows cant
Interesting situation if Backend mounted is Linux style Frontend is connected via client Windows style ... The result would be, without having that tested, that NTFS in front will do a cut on files recieved and triggers by that an upload to the backend. If there are files only differenciated by the quantity of blanks at the end, this would end up in a mess.
In case we would restrict creation in core we would be safe on the creation side.
The thing remains, what to do if you mount a linux style FS like you can do with FTP
...must follow the file naming conventions of the file systems involved in the transfer
.
@PVince81 @DeepDiver1975
@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.
:man_facepalming:
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.
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