Skip to content

Improve quota validation including a regexp which matches expected formats #25358

Closed

Description

@SergioBertolinSG

Curently an admin user can enter a number probably followed by letters.
For example: "200", "15MB" or "5 GB" "20B".
Basically it's a number probably followed by letters.

Also floating point can be entered, but only in english style "2.5GB". Using a non english format for floats will lead to an old bug "4,5GB" also something like "45/0".

So the proposed enhancement by @PVince81 in #25253 is to develop a regexp to validate better this values.

Activity

  1. added this to the milestone on Jul 5, 2016
  2. PVince81 commented on Jul 5, 2016

    @PVince81
    Contributor

    Thanks for the ticket, makes sense

  3. andypmw commented on Oct 6, 2016

    @andypmw

    Hi guys, I am create a regex formula for this issue:
    ^( +)?([+-])?[\s+]?([0-9]*)(\.([0-9]+))?( +)?(b|kb|mb|gb|tb|pb|eb|zb|yb)?

    I will try to write on PHP and create pull request

  4. PVince81 commented on Oct 7, 2016

    @PVince81
    Contributor

    @andypmw sounds good, thanks!

  5. SergioBertolinSG commented on Oct 7, 2016

    @SergioBertolinSG
    ContributorAuthor

    I will try to write on PHP and create pull request

    I guess this validation should be done in the frontend: settings/js/users/users.js https://github.com/owncloud/core/blob/master/settings/js/users/users.js

  6. JKawohl commented on Oct 25, 2016

    @JKawohl
    Contributor

    @andypmw Did you make any progress yet?

  7. PVince81 commented on Dec 8, 2016

    @PVince81
    Contributor

    @ppaysant has added a new JS method for parsing this kind of strings, see #26789

  8. modified the milestones: backlog, 10.0 on Dec 8, 2016
  9. SamuAlfageme commented on Dec 14, 2016

    @SamuAlfageme

    Think this is a must, since input an invalid quota (e.g. any alphanumeric string) and you'll end up with this funky quota list made with Bs:

    screen shot 2016-12-14 at 10 34 56

    Note that the last "Other" option has been replaced by another B.

  10. individual-it commented on Feb 28, 2017

    @individual-it
    Member

    reopening as this is not fixed yet #27257 only fixed the function that could potentially be used for validation but its not implemented in the onQuotaSelect function.
    maybe I should not have put in "prerapation to fix #25358" in the header of the PR

  11. added a commit that references this issue on Mar 1, 2017
    a35743b
  12. SergioBertolinSG commented on Mar 8, 2017

    @SergioBertolinSG
    ContributorAuthor

    Tested and works fine.

    But repeated values are added to the dropdown. They vanish when reloading the page. @PVince81 there is an open issue about this bug? I cannot find it.

  13. phil-davis commented on Sep 27, 2017

    @phil-davis
    Contributor

    The fix here did not allow a 0 byte quota to be entered. See separate issue #29105 and PR #29109

  14. phil-davis commented on Sep 29, 2017

    @phil-davis
    Contributor

    @SergioBertolinSG I raised a separate issue #29122 for the repeated values added to the dropdown.

  15. lock commented on Aug 2, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  16. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions