Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -121,6 +121,7 @@ |
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Fetch initial editing page content. |
| 125 | + * @returns mixed string on success, $def_text for invalid sections |
125 | 126 | * @private |
126 | 127 | */ |
127 | 128 | function getContent( $def_text = '' ) { |
— | — | @@ -204,6 +205,7 @@ |
205 | 206 | if ( $section == 'new' ) { |
206 | 207 | $text = $this->getPreloadedText( $preload ); |
207 | 208 | } else { |
| 209 | + // Get section edit text (returns $def_text for invalid sections) |
208 | 210 | $text = $wgParser->getSection( $text, $section, $def_text ); |
209 | 211 | } |
210 | 212 | } |
— | — | @@ -403,7 +405,7 @@ |
404 | 406 | $permErrors = $this->getEditPermissionErrors(); |
405 | 407 | if ( $permErrors ) { |
406 | 408 | wfDebug( __METHOD__ . ": User can't edit\n" ); |
407 | | - $this->readOnlyPage( $this->getContent(), true, $permErrors, 'edit' ); |
| 409 | + $this->readOnlyPage( $this->getContent( false ), true, $permErrors, 'edit' ); |
408 | 410 | wfProfileOut( __METHOD__ ); |
409 | 411 | return; |
410 | 412 | } else { |
— | — | @@ -1183,6 +1185,7 @@ |
1184 | 1186 | /** |
1185 | 1187 | * Initialise form fields in the object |
1186 | 1188 | * Called on the first invocation, e.g. when a user clicks an edit link |
| 1189 | + * @returns bool -- if the requested section is valid |
1187 | 1190 | */ |
1188 | 1191 | function initialiseForm() { |
1189 | 1192 | global $wgUser; |