API: Don't dump Title object into API result
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 3 Feb 2015 15:01:08 +0000 (10:01 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 3 Feb 2015 15:01:08 +0000 (10:01 -0500)
The intention here is to return the title as a text string, not to dump
all the internal fields of Title.

Bug: T88397
Change-Id: I43ad3c98bc1fc056a13f57e2e95a122108049334

includes/api/ApiQuerySearch.php

index 16a491e..e489b2f 100644 (file)
@@ -174,7 +174,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                }
                                if ( !is_null( $result->getRedirectTitle() ) ) {
                                        if ( isset( $prop['redirecttitle'] ) ) {
-                                               $vals['redirecttitle'] = $result->getRedirectTitle();
+                                               $vals['redirecttitle'] = $result->getRedirectTitle()->getPrefixedText();
                                        }
                                        if ( isset( $prop['redirectsnippet'] ) ) {
                                                $vals['redirectsnippet'] = $result->getRedirectSnippet();