Index: trunk/extensions/Collection/Collection.php |
— | — | @@ -182,13 +182,15 @@ |
183 | 183 | $collection = $json->decode( $collection ); |
184 | 184 | $collection['enabled'] = true; |
185 | 185 | $_SESSION['wsCollection'] = $collection; |
186 | | - $title = SpecialPage::getTitleFor( 'Book' ); |
187 | | - $redirecturl = $title->getFullURL( $urlaction ); |
188 | 186 | $r = new AjaxResponse(); |
189 | 187 | if ( $redirect ) { |
| 188 | + $title = Title::newFromText( $redirect ); |
| 189 | + $redirecturl = $title->getFullURL(); |
190 | 190 | $r->setResponseCode( 302 ); |
191 | 191 | header( 'Location: ' . $redirecturl ); |
192 | 192 | } else { |
| 193 | + $title = SpecialPage::getTitleFor( 'Book' ); |
| 194 | + $redirecturl = $title->getFullURL(); |
193 | 195 | $r->setContentType( 'application/json' ); |
194 | 196 | $r->addText( $json->encode( array( 'redirect_url' => $redirecturl ) ) ); |
195 | 197 | } |