Skip to content

Commit fa11bbe

Browse files
committed
Merge pull request mozilla#15 from brandonsavage/bug729259
Allow multiple parameters and clean up the way we go about handling defa...
2 parents 7ba55fd + e4865dd commit fa11bbe

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

BugzillaQuery.class.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ function __construct($type, $options, $title='') {
188188
public function _fetch_by_options() {
189189

190190
// Set up our HTTP request
191-
$request = new HTTP_Request2($this->url,
191+
$options_array = array();
192+
193+
$options_array = array(Net_Url2::OPTION_USE_BRACKETS => false);
194+
$net_url2 = new Net_Url2($this->url, $options_array);
195+
$request = new HTTP_Request2($net_url2,
192196
HTTP_Request2::METHOD_GET,
193197
array('follow_redirects' => TRUE,
194198
// TODO: Not sure if I should do this
@@ -200,13 +204,25 @@ public function _fetch_by_options() {
200204

201205
// Save the real options
202206
$saved_options = $this->options;
203-
207+
208+
if(!isset($this->options['include_fields'])) {
209+
$this->options['include_fields'] = array();
210+
}
211+
212+
if(!is_array($this->options['include_fields'])) {
213+
(array)$this->options['include_fields'];
214+
}
215+
204216
// Add any synthetic fields to the options
205217
if( !empty($this->synthetic_fields) ) {
206218
$this->options['include_fields'] =
207219
@array_merge((array)$this->options['include_fields'],
208220
$this->synthetic_fields);
209221
}
222+
223+
if(!empty($this->options['include_fields'])) {
224+
$this->options['include_fields'] = implode(",", $this->options['include_fields']);
225+
}
210226

211227
// Add the requested query options to the request
212228
$url = $request->getUrl();

0 commit comments

Comments
 (0)