Skip to content

validate file name before uploading in upload only folder - #4212

Merged
nickvergessen merged 4 commits into
nextcloud:masterfrom
individual-it:master
Apr 20, 2017
Merged

nickvergessen merged 4 commits into
nextcloud:masterfrom
individual-it:master

Conversation

@individual-it

Copy link
Copy Markdown
Contributor

before uploading in a upload-only folder the file name was not checked with JS and no error was presented to the user if an invalid file was uploaded.
Even worse the UI would list the invalid file in the "Uploaded files" list.
This PR adds a check that is the same as in https://github.com/nextcloud/server/blob/master/apps/files/js/file-upload.js#L793
fixes #4211

@mention-bot

Copy link
Copy Markdown

@individual-it, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @rullzer and @blizzz to be potential reviewers.

@individual-it

Copy link
Copy Markdown
Contributor Author

I cannot find any tests for the upload-only page, are there any?

@blizzz

blizzz commented Apr 5, 2017

Copy link
Copy Markdown
Member

perhaps here? apps/files_sharing/tests/js/publicAppSpec.js at least there is an upload-specific part, small though.

@blizzz blizzz added bug feature: sharing papercut Annoying recurring UX issue with possibly simple fix. 2. developing Work in progress labels Apr 5, 2017
@blizzz blizzz added this to the Nextcloud 12.0 milestone Apr 5, 2017
@individual-it

individual-it commented Apr 5, 2017 •

Copy link
Copy Markdown
Contributor Author

@blizzz

perhaps here? apps/files_sharing/tests/js/publicAppSpec.js at least there is an upload-specific part, small though.

That does look to me like its for public upload generally not specific for upload-only folders. So this function might be pretty untested, at least the JS side of it

@rullzer

rullzer commented Apr 5, 2017

Copy link
Copy Markdown
Member

yes unfortunatly it is pretty untested...

@blizzz

blizzz commented Apr 6, 2017

Copy link
Copy Markdown
Member

So, let's go out without for now? Or are you eager do add tests @individual-it? :) :) :)

@individual-it

Copy link
Copy Markdown
Contributor Author

Or are you eager do add tests?

Generally speaking: Yes! Are you eager to pay me for that :-) ?

My business partner @phil-davis (from Australia) and me (from Germany), we both lived in Nepal for the past 6/8 years and have worked here for an big NGO, now we have moved on and are in the process of starting a Software Development Company in Nepal @JankariTech

Writing automated tests is exactly the service we are planing to offer. The idea is to teach young Nepali IT graduates to write good automated tests and to offer to write tests to companies that do not have enough testing for their projects.

If you are interested happy to keep on talking by Email ([email protected]) or Skype

@schiessle

Copy link
Copy Markdown
Member

Generally speaking: Yes! Are you eager to pay me for that :-) ?
Writing automated tests is exactly the service we are planing to offer.

Well, showing us and the rest of the world your test-writing-skills here would be the best possible advertisement for your new company 😉

@codecov

codecov Bot commented Apr 18, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #4212 into master will increase coverage by 0.01%.
The diff coverage is 89.28%.

@@             Coverage Diff              @@
##             master    #4212      +/-   ##
============================================
+ Coverage     54.07%   54.08%   +0.01%     
  Complexity    21589    21589              
============================================
  Files          1327     1328       +1     
  Lines         82303    82367      +64     
  Branches       1305     1311       +6     
============================================
+ Hits          44509    44552      +43     
- Misses        37794    37815      +21
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/js/files_drop.js 60.93% <89.28%> (ø) 0 <0> (?)
core/js/js.js 62.41% <0%> (+0.23%) 0% <0%> (ø) ⬇️
apps/comments/lib/EventHandler.php 87.5% <0%> (+8.33%) 7% <0%> (ø) ⬇️

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 19, 2017

@MorrisJobke MorrisJobke 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.

Tested and works 👍

@MorrisJobke

Copy link
Copy Markdown
Member

@schiessle @nickvergessen @blizzz Please review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug feature: sharing papercut Annoying recurring UX issue with possibly simple fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show error messages in Files Drop (upload only)

7 participants