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

Use helper method to safeguard against empty path parameters #498

Merged
merged 6 commits into from
Jun 13, 2020

Conversation

joannasese
Copy link
Contributor

Addresses same issue fixed in V3: #494

Adding a helper method to prevent empty strings from being passed in as accepted path parameters for all applicable GET requests.

Example:
$item = Recurly_Item::get("") would return <Recurly_ItemList[href=/items/]>. This occurred because uri = 'items/' instead of uri = 'items/{item_code}'. Helper method throws an error when resource code is empty.

@joannasese joannasese added bug V2 V2 Client labels May 12, 2020
@joannasese joannasese changed the title Use helper method to safeguard against empty path parameters [WIP] Use helper method to safeguard against empty path parameters May 12, 2020
@joannasese joannasese changed the title [WIP] Use helper method to safeguard against empty path parameters Use helper method to safeguard against empty path parameters May 12, 2020
@joannasese joannasese requested a review from bhelx May 12, 2020 23:08
lib/recurly/addon.php Outdated Show resolved Hide resolved
@joannasese joannasese force-pushed the validate-path-parameters branch 2 times, most recently from b984e23 to 5b81e5a Compare May 15, 2020 02:24
Rename helper function
Consolidate variables
Include url encoder in helper function
lib/recurly/base.php Outdated Show resolved Hide resolved
lib/recurly/base.php Outdated Show resolved Hide resolved
Tests/Recurly/Base_Test.php Outdated Show resolved Hide resolved
Tests/Recurly/Base_Test.php Outdated Show resolved Hide resolved
Tests/Recurly/Base_Test.php Outdated Show resolved Hide resolved
lib/recurly/base.php Outdated Show resolved Hide resolved
- Build helper function to encode resource codes for URI
- Isolate addition of URI forward slashes to within helper function
- Safeguard against empty resource codes passed in as params
@bhelx bhelx merged commit 632a8f5 into v2 Jun 13, 2020
@bhelx bhelx deleted the validate-path-parameters branch June 13, 2020 00:02
@joannasese joannasese mentioned this pull request Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V2 V2 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants