Index: trunk/extensions/Collection/Collection.php |
— | — | @@ -129,7 +129,9 @@ |
130 | 130 | } else { |
131 | 131 | $collection = array(); |
132 | 132 | } |
133 | | - return $json->encode( array( 'collection' => $collection ) ); |
| 133 | + $r = new AjaxResponse( $json->encode( array( 'collection' => $collection ) ) ); |
| 134 | + $r->setContentType( 'application/json' ); |
| 135 | + return $r; |
134 | 136 | } |
135 | 137 | |
136 | 138 | $wgAjaxExportList[] = 'wfAjaxGetCollection'; |
— | — | @@ -141,7 +143,9 @@ |
142 | 144 | } |
143 | 145 | $collection = $json->decode( $collection ); |
144 | 146 | $_SESSION['wsCollection'] = $collection; |
145 | | - return $json->encode( array( 'collection' => $collection ) ); |
| 147 | + $r = new AjaxResponse( $json->encode( array( 'collection' => $collection ) ) ); |
| 148 | + $r->setContentType( 'application/json' ); |
| 149 | + return $r; |
146 | 150 | } |
147 | 151 | |
148 | 152 | $wgAjaxExportList[] = 'wfAjaxPostCollection'; |
— | — | @@ -152,7 +156,9 @@ |
153 | 157 | 'collection_id' => $collection_id, |
154 | 158 | 'writer' => $writer |
155 | 159 | ) ); |
156 | | - return $json->encode( $result ); |
| 160 | + $r = new AjaxResponse( $json->encode( $result ) ); |
| 161 | + $r->setContentType( 'application/json' ); |
| 162 | + return $r; |
157 | 163 | } |
158 | 164 | |
159 | 165 | $wgAjaxExportList[] = 'wfAjaxGetMWServeStatus'; |