Repository navigation
Do not allow invalid default expire days - #13949
Conversation
|
I think we should check that on the php end? |
|
I agree, the validation must be done in the PHP endpoint instead. |
|
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. |
|
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 |
|
needs rebase -> move to 8.2 |
|
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). |
|
@rullzer what is the status of this? |
|
Hmmm I understand now. It's just a generic config param that is set from the JS side. 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. |
|
@PVince81 yes that is the issue. 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.
|
A new inspection was created. |
|
Rebased. |
|
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. |
|
I'm fine with this. cc @schiesbn @DeepDiver1975 |
|
👍 @MorrisJobke counting your "I am fine" as 👍 too. |
Do not allow invalid default expire days

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.