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

fix: remove preceding and trailing whitespace from config #40950

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AlexsLaboratory
Copy link

Description

Create recursive function to remove white space during the writing of the config/config.php file. This will remove white space from nested array values as well (hence the recursive function).

Related Issue

Motivation and Context

Solves issues with the SMTP server input where if there were white spaces preceding or succeeding the input the connection would error out. Creates a better user experience for the user as sometimes you may not see that you entered a white space either before or after an input.

How Has This Been Tested?

test environment:

  • OS: Ubuntu 22.04 LTS
  • Database: PostgreSQL 14
  • Web Server: Apache2

Testing Procedure

  • Modified PHPUnit testSetValue() test to add white space and the beginning and end of a value and then make sure that the output does not include white space.

Screenshots (if appropriate):

image
SMTP server address with preceding and succeeding spaces.

image
Saved value in config/config.php that has preceding and succeeding white spaces removed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs
Copy link

update-docs bot commented Aug 26, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2023

CLA assistant check
All committers have signed the CLA.

@AlexsLaboratory
Copy link
Author

Having trouble getting the tests to run. I have tried to go back and run tests on my machine before I added changes but they still don't all finish properly. Any advice on how to get OC unit tests setup properly on a Ubuntu 22.04 LTS system?

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.

Text fields should trim blanks
2 participants