Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Auctions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Wilcox Technologies
Auctions
Commits
02b61fdd
Verified
Commit
02b61fdd
authored
Sep 10, 2012
by
A. Wilcox
Committed by
A. Wilcox
Jul 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Etsy: Encode shipping profile name before using.
This fixes a bug reported by two customers.
parent
4e140c0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Common/Models/EtsySite.cpp
Common/Models/EtsySite.cpp
+6
-2
No files found.
Common/Models/EtsySite.cpp
View file @
02b61fdd
...
...
@@ -957,6 +957,7 @@ libAPI bool EtsySite::createShippingProfile(const char *name, uint64_t origin,
char
*
endpoint
=
NULL
;
char
*
country_region
=
NULL
;
char
*
encoded_name
=
URLEncode
(
name
);
if
(
entries
.
at
(
0
)
->
dest_country
!=
0
)
{
...
...
@@ -973,7 +974,7 @@ libAPI bool EtsySite::createShippingProfile(const char *name, uint64_t origin,
asprintf
(
&
endpoint
,
"shipping/templates?title=%s&origin_country_id=%llu\
&primary_cost=%0.02f&secondary_cost=%0.02f%s"
,
name
,
encoded_
name
,
origin
,
entries
.
at
(
0
)
->
primary_cost
,
entries
.
at
(
0
)
->
secondary_cost
,
...
...
@@ -981,6 +982,7 @@ libAPI bool EtsySite::createShippingProfile(const char *name, uint64_t origin,
if
(
endpoint
==
NULL
)
alloc_error
(
"shipping template URL"
,
50
);
free
(
encoded_name
);
free
(
country_region
);
JSONNode
*
profile_node
=
this
->
write_to
(
endpoint
,
NULL
,
true
);
...
...
@@ -1007,10 +1009,12 @@ libAPI bool EtsySite::changeShippingProfileName(EtsyShippingProfile *profile,
REQUIRES_AUTH
char
*
endpoint
=
NULL
;
char
*
encoded_name
=
URLEncode
(
name
);
asprintf
(
&
endpoint
,
"shipping/templates/%llu?title=%s"
,
profile
->
getID
(),
name
);
encoded_
name
);
if
(
endpoint
==
NULL
)
alloc_error
(
"shipping template update URL"
,
20
);
free
(
encoded_name
);
JSONNode
*
result
=
this
->
put_at
(
endpoint
,
NULL
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment