From: Sam Reed Date: Thu, 22 Jul 2010 07:00:38 +0000 (+0000) Subject: Fix bug from r61759 X-Git-Tag: 1.31.0-rc.0~36018 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=c0acaca806864a196fab222897c4527a7ba9209c;p=lhc%2Fweb%2Fwiklou.git Fix bug from r61759 Assign $text = null; before using it in a hook call --- diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 7a32691c41..f75b54e3d0 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -210,6 +210,7 @@ class ApiQueryInfo extends ApiQueryBase { $this->fld_url = isset( $prop['url'] ); $this->fld_readable = isset( $prop['readable'] ); $this->fld_preload = isset( $prop['preload'] ); + $this->fld_displaytitle = isset( $prop['displaytitle'] ); } $pageSet = $this->getPageSet(); @@ -290,6 +291,7 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] ); $pageInfo['counter'] = intval( $this->pageCounter[$pageid] ); $pageInfo['length'] = intval( $this->pageLength[$pageid] ); + if ( $this->pageIsRedir[$pageid] ) { $pageInfo['redirect'] = ''; } @@ -347,11 +349,17 @@ class ApiQueryInfo extends ApiQueryBase { if ( $title->exists() ) { $pageInfo['preload'] = ''; } else { + $text = null; wfRunHooks( 'EditFormPreloadText', array( &$text, &$title ) ); $pageInfo['preload'] = $text; } } + + if ( $this->fld_displaytitle ) { + + } + return $pageInfo; } @@ -602,7 +610,8 @@ class ApiQueryInfo extends ApiQueryBase { ' subjectid - The page ID of the parent page for each talk page', ' url - Gives a full URL to the page, and also an edit URL', ' readable - Whether the user can read this page', - ' preload - Gives the text returned by EditFormPreloadText' + ' preload - Gives the text returned by EditFormPreloadText', + ' displaytitle - Gives the way the page title is actually displayed', ), 'token' => 'Request a token to perform a data-modifying action on a page', 'continue' => 'When more results are available, use this to continue',