Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #6452 - Api/V8 create record does not support unicode and space in attributes #6901

Closed

Conversation

Dillon-Brown
Copy link
Contributor

@Dillon-Brown Dillon-Brown commented Feb 6, 2019

Description

Duplicate of #6861 for hotfix-7.10.x to fix issue #6452. This also fixes #6893.

How To Test This

POST SuiteCRM/Api/V8/module
BODY {
  "data": {
    "type": "Accounts",
    "attributes": {
      "name": "Cocacola company",
      "description": "very friendly account"
    }
  }
}
  1. Try to pass in non-valid attributes like decimals and integers to ensure that this validation is not necessary due to database sanitization.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@Dillon-Brown
Copy link
Contributor Author

Dillon-Brown commented Feb 6, 2019

Alternatively something like:

const REGEX_FIELD_PATTERN = '/[^\w-,\s\\.\]]/';

in attributes.php would work but I think it's unnecessary.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (hotfix-7.10.x@50a24c7). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             hotfix-7.10.x    #6901   +/-   ##
================================================
  Coverage                 ?    7.31%           
================================================
  Files                    ?     3735           
  Lines                    ?   386799           
  Branches                 ?        0           
================================================
  Hits                     ?    28295           
  Misses                   ?   358504           
  Partials                 ?        0

@Dillon-Brown Dillon-Brown changed the title Fixed #6452 - Api/V8 create record does not support unicode and space… Fixed #6452 - Api/V8 create record does not support unicode and space in attributes Mar 26, 2019
@gymad
Copy link
Contributor

gymad commented Mar 26, 2019

would work but I think it's unnecessary.

Unnecessary only if we don't want to use the slim middleware for validation. However I think much less expensive regex if you just add /.*/ or /^./ both accept everything.

@samus-aran
Copy link
Contributor

Not accepted. :) preferred solution will be provided.

@samus-aran samus-aran closed this Apr 2, 2019
@Dillon-Brown Dillon-Brown deleted the issue-6452 branch April 8, 2019 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants