Index: trunk/phase3/includes/Title.php |
— | — | @@ -179,20 +179,15 @@ |
180 | 180 | /** |
181 | 181 | * Create a new Title from an article ID |
182 | 182 | * |
183 | | - * @todo This is inefficiently implemented, the page row is requested |
184 | | - * but not used for anything else |
185 | | - * |
186 | 183 | * @param $id \type{\int} the page_id corresponding to the Title to create |
187 | 184 | * @param $flags \type{\int} use GAID_FOR_UPDATE to use master |
188 | 185 | * @return \type{Title} the new object, or NULL on an error |
189 | 186 | */ |
190 | 187 | public static function newFromID( $id, $flags = 0 ) { |
191 | | - $fname = 'Title::newFromID'; |
192 | 188 | $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
193 | | - $row = $db->selectRow( 'page', array( 'page_namespace', 'page_title' ), |
194 | | - array( 'page_id' => $id ), $fname ); |
195 | | - if ( $row !== false ) { |
196 | | - $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 189 | + $row = $db->selectRow( 'page', '*', array( 'page_id' => $id ), __METHOD__ ); |
| 190 | + if( $row !== false ) { |
| 191 | + $title = Title::newFromRow( $row ); |
197 | 192 | } else { |
198 | 193 | $title = NULL; |
199 | 194 | } |