Skip to content

Commit ab41cad

Browse files
committed
[RelEng] Escape single quotes in data of queries to the GitHub API
1 parent 70c6fc2 commit ab41cad

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

JenkinsJobs/shared/githubAPI.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def queryGithubAPI(String method, String endpoint, Map<String, Object> queryPara
131131
""".replace('\t','').trim()
132132
if (queryParameters != null) {
133133
def params = writeJSON(json: queryParameters, returnText: true)
134+
params = params.replace("'", "'\\''") // Escape single quotes by '\''
134135
query += " -d '" + params + "'"
135136
}
136137
if (_GH_API_IS_DRY_RUN && !method.isEmpty()) {

0 commit comments

Comments
 (0)