Open JOJOKAHANDING opened 8 years ago
In Jira.php:
OLD CODE
public function queryIssue($query) { function createPairs($obj) { $str = ""; foreach ($obj as $key => $value) { if ($key != 'jql') { $str .= "$key=$value&"; } else { $str .= trim($value, '"\'@') . '&'; } } return rtrim($str, '&'); } $qs = createPairs($query);
SUGGESTED CHANGE
protected function createPairs($obj) { $str = ""; foreach ($obj as $key => $value) { if ($key != 'jql') { $str .= "$key=$value&"; } else { $str .= trim($value, '"\'@') . '&'; } } return rtrim($str, '&'); } public function queryIssue($query) { $qs = $this->createPairs($query); $qs = urlencode($qs); $this->request->OpenConnect($this->host . 'search?jql=' . $qs); $this->request->execute(); $result = json_decode($this->request->getResponseBody()); if (isset($result->issues)) { return $result->issues; } return false; }
In Jira.php:
OLD CODE
SUGGESTED CHANGE