Skip to content

Do not allow invalid default expire days - #13949

Merged
PVince81 merged 1 commit into
owncloud:masterfrom
rullzer:no_negative_expire
Aug 7, 2015
Merged

PVince81 merged 1 commit into
owncloud:masterfrom
rullzer:no_negative_expire

Conversation

@rullzer

@rullzer rullzer commented Feb 6, 2015

Copy link
Copy Markdown
Contributor

Currently it is possible to set a negative number of days in which a
public share expires. This results in public sharing not working and it
is undesired.

Weird thing is that the API still lets you create shares and gives back
an URL. However the id is "unkown" and the URL invalid.

@nickvergessen

Copy link
Copy Markdown
Contributor

I think we should check that on the php end?

@PVince81

PVince81 commented Feb 9, 2015

Copy link
Copy Markdown
Contributor

I agree, the validation must be done in the PHP endpoint instead.
Also need to check whether the OCS Share API allows for such invalid values too.

@rullzer

rullzer commented Feb 10, 2015

Copy link
Copy Markdown
Contributor Author

I agree as well. However there needs to be a discussion then on how to do this properly. Just hacking it in seems not very future proof. Ideally you would have some kind of list with the config options and the possible values associated with it.

@nickvergessen

Copy link
Copy Markdown
Contributor

Okay, there is no "php side", since it uses the JS stuff, below the changed diff:

OC.AppConfig.setValue('core', $(this).attr('name'), value);

your turn @PVince81

@DeepDiver1975 DeepDiver1975 modified the milestones: 8.2-next, 8.1-current Apr 9, 2015
@DeepDiver1975

Copy link
Copy Markdown
Contributor

needs rebase -> move to 8.2

@rullzer

rullzer commented Apr 11, 2015

Copy link
Copy Markdown
Contributor Author

Rebased. But we need to decide if this is the way we want to go or if we want to fix it on the php side (which requires significantly more work).

@MorrisJobke

Copy link
Copy Markdown
Contributor

@rullzer what is the status of this?

@PVince81

PVince81 commented Jul 3, 2015

Copy link
Copy Markdown
Contributor

Hmmm I understand now. It's just a generic config param that is set from the JS side.
So this PR would at least prevent user error.

Please note that in the future it will be possible to set config params from ./occ (I think @nickvergessen was working on this), so this kind of issue could happen as well.

But to make a proper validation, one would need to add validation code for every configuration parameter in PHP.

@rullzer

rullzer commented Jul 4, 2015

Copy link
Copy Markdown
Contributor Author

@PVince81 yes that is the issue.
This is only a quick fix.

The long term solution would be to have some grammar that describes all the config variables. And then checks those. But that is a lot more work. But probably something that should be done to protect users from the many errors they can make.

Currently it is possible to set a negative number of days in which a
public share expires. This results in public sharing not working and it
undesired.

Weird thing is that the API still lets you create shares and gives back
an URL. However the id is "unkown" and the URL invalid.
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@rullzer

rullzer commented Jul 4, 2015

Copy link
Copy Markdown
Contributor Author

Rebased.
Btw, we need tests for those settings pages.

@ghost

ghost commented Jul 4, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

@rullzer

rullzer commented Jul 21, 2015

Copy link
Copy Markdown
Contributor Author

So what do we want to do here? Merge or not. This PR is just to prevent user error. But by no means fixes the underlying issue.

@MorrisJobke

Copy link
Copy Markdown
Contributor

I'm fine with this. cc @schiesbn @DeepDiver1975

@MorrisJobke

Copy link
Copy Markdown
Contributor

cc @nickvergessen @PVince81

@PVince81

PVince81 commented Aug 7, 2015

Copy link
Copy Markdown
Contributor

👍

@MorrisJobke counting your "I am fine" as 👍 too.
Merging.

PVince81 pushed a commit that referenced this pull request Aug 7, 2015
Do not allow invalid default expire days
@PVince81
PVince81 merged commit cf53224 into owncloud:master Aug 7, 2015
@rullzer
rullzer deleted the no_negative_expire branch October 1, 2015 11:06
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants