Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1001,14 +1001,6 @@ |
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | /** |
1005 | | - * @deprecated use parserOptions() instead |
1006 | | - */ |
1007 | | - public function setParserOptions( $options ) { |
1008 | | - wfDeprecated( __METHOD__ ); |
1009 | | - return $this->parserOptions( $options ); |
1010 | | - } |
1011 | | - |
1012 | | - /** |
1013 | 1005 | * Get/set the ParserOptions object to use for wikitext parsing |
1014 | 1006 | * |
1015 | 1007 | * @param $options either the ParserOption to use or null to only get the |
— | — | @@ -1119,43 +1111,6 @@ |
1120 | 1112 | } |
1121 | 1113 | |
1122 | 1114 | /** |
1123 | | - * Add wikitext to the buffer, assuming that this is the primary text for a page view |
1124 | | - * Saves the text into the parser cache if possible. |
1125 | | - * |
1126 | | - * @param $text String: wikitext |
1127 | | - * @param $article Article object |
1128 | | - * @param $cache Boolean |
1129 | | - * @deprecated Use Article::outputWikitext |
1130 | | - */ |
1131 | | - public function addPrimaryWikiText( $text, $article, $cache = true ) { |
1132 | | - global $wgParser; |
1133 | | - |
1134 | | - wfDeprecated( __METHOD__ ); |
1135 | | - |
1136 | | - $popts = $this->parserOptions(); |
1137 | | - $popts->setTidy( true ); |
1138 | | - $parserOutput = $wgParser->parse( |
1139 | | - $text, $article->mTitle, |
1140 | | - $popts, true, true, $this->mRevisionId |
1141 | | - ); |
1142 | | - $popts->setTidy( false ); |
1143 | | - if ( $cache && $article && $parserOutput->isCacheable() ) { |
1144 | | - $parserCache = ParserCache::singleton(); |
1145 | | - $parserCache->save( $parserOutput, $article, $popts ); |
1146 | | - } |
1147 | | - |
1148 | | - $this->addParserOutput( $parserOutput ); |
1149 | | - } |
1150 | | - |
1151 | | - /** |
1152 | | - * @deprecated use addWikiTextTidy() |
1153 | | - */ |
1154 | | - public function addSecondaryWikiText( $text, $linestart = true ) { |
1155 | | - wfDeprecated( __METHOD__ ); |
1156 | | - $this->addWikiTextTitleTidy( $text, $this->getTitle(), $linestart ); |
1157 | | - } |
1158 | | - |
1159 | | - /** |
1160 | 1115 | * Add a ParserOutput object, but without Html |
1161 | 1116 | * |
1162 | 1117 | * @param $parserOutput ParserOutput object |
— | — | @@ -1283,24 +1238,6 @@ |
1284 | 1239 | } |
1285 | 1240 | |
1286 | 1241 | /** |
1287 | | - * @deprecated |
1288 | | - * |
1289 | | - * @param $article Article |
1290 | | - * @return Boolean: true if successful, else false. |
1291 | | - */ |
1292 | | - public function tryParserCache( &$article ) { |
1293 | | - wfDeprecated( __METHOD__ ); |
1294 | | - $parserOutput = ParserCache::singleton()->get( $article, $article->getParserOptions() ); |
1295 | | - |
1296 | | - if ( $parserOutput !== false ) { |
1297 | | - $this->addParserOutput( $parserOutput ); |
1298 | | - return true; |
1299 | | - } else { |
1300 | | - return false; |
1301 | | - } |
1302 | | - } |
1303 | | - |
1304 | | - /** |
1305 | 1242 | * Set the value of the "s-maxage" part of the "Cache-control" HTTP header |
1306 | 1243 | * |
1307 | 1244 | * @param $maxage Integer: maximum cache time on the Squid, in seconds. |
— | — | @@ -1756,17 +1693,6 @@ |
1757 | 1694 | } |
1758 | 1695 | |
1759 | 1696 | /** |
1760 | | - * @deprecated use wfReportTime() instead. |
1761 | | - * |
1762 | | - * @return String |
1763 | | - */ |
1764 | | - public function reportTime() { |
1765 | | - wfDeprecated( __METHOD__ ); |
1766 | | - $time = wfReportTime(); |
1767 | | - return $time; |
1768 | | - } |
1769 | | - |
1770 | | - /** |
1771 | 1697 | * Produce a "user is blocked" page. |
1772 | 1698 | * |
1773 | 1699 | * @param $return Boolean: whether to have a "return to $wgTitle" message or not. |
— | — | @@ -2101,53 +2027,6 @@ |
2102 | 2028 | $this->addModules( 'mediawiki.legacy.password' ); |
2103 | 2029 | } |
2104 | 2030 | |
2105 | | - /** @deprecated */ |
2106 | | - public function errorpage( $title, $msg ) { |
2107 | | - wfDeprecated( __METHOD__ ); |
2108 | | - throw new ErrorPageError( $title, $msg ); |
2109 | | - } |
2110 | | - |
2111 | | - /** @deprecated */ |
2112 | | - public function databaseError( $fname, $sql, $error, $errno ) { |
2113 | | - throw new MWException( "OutputPage::databaseError is obsolete\n" ); |
2114 | | - } |
2115 | | - |
2116 | | - /** @deprecated */ |
2117 | | - public function fatalError( $message ) { |
2118 | | - wfDeprecated( __METHOD__ ); |
2119 | | - throw new FatalError( $message ); |
2120 | | - } |
2121 | | - |
2122 | | - /** @deprecated */ |
2123 | | - public function unexpectedValueError( $name, $val ) { |
2124 | | - wfDeprecated( __METHOD__ ); |
2125 | | - throw new FatalError( wfMsg( 'unexpected', $name, $val ) ); |
2126 | | - } |
2127 | | - |
2128 | | - /** @deprecated */ |
2129 | | - public function fileCopyError( $old, $new ) { |
2130 | | - wfDeprecated( __METHOD__ ); |
2131 | | - throw new FatalError( wfMsg( 'filecopyerror', $old, $new ) ); |
2132 | | - } |
2133 | | - |
2134 | | - /** @deprecated */ |
2135 | | - public function fileRenameError( $old, $new ) { |
2136 | | - wfDeprecated( __METHOD__ ); |
2137 | | - throw new FatalError( wfMsg( 'filerenameerror', $old, $new ) ); |
2138 | | - } |
2139 | | - |
2140 | | - /** @deprecated */ |
2141 | | - public function fileDeleteError( $name ) { |
2142 | | - wfDeprecated( __METHOD__ ); |
2143 | | - throw new FatalError( wfMsg( 'filedeleteerror', $name ) ); |
2144 | | - } |
2145 | | - |
2146 | | - /** @deprecated */ |
2147 | | - public function fileNotFoundError( $name ) { |
2148 | | - wfDeprecated( __METHOD__ ); |
2149 | | - throw new FatalError( wfMsg( 'filenotfound', $name ) ); |
2150 | | - } |
2151 | | - |
2152 | 2031 | public function showFatalError( $message ) { |
2153 | 2032 | $this->setPageTitle( wfMsg( 'internalerror' ) ); |
2154 | 2033 | $this->setRobotPolicy( 'noindex,nofollow' ); |
— | — | @@ -2917,7 +2796,7 @@ |
2918 | 2797 | * @param $modules Array: list of jQuery modules which should be loaded |
2919 | 2798 | * @return Array: the list of modules which were not loaded. |
2920 | 2799 | * @since 1.16 |
2921 | | - * @deprecated No longer needed as of 1.17 |
| 2800 | + * @deprecated @since 1.17 |
2922 | 2801 | */ |
2923 | 2802 | public function includeJQuery( $modules = array() ) { |
2924 | 2803 | return array(); |
Index: trunk/phase3/includes/specials/SpecialComparePages.php |
— | — | @@ -40,47 +40,6 @@ |
41 | 41 | parent::__construct( 'ComparePages' ); |
42 | 42 | } |
43 | 43 | |
44 | | - protected function setup( $par ) { |
45 | | - global $wgRequest, $wgUser; |
46 | | - |
47 | | - // Options |
48 | | - $opts = new FormOptions(); |
49 | | - $this->opts = $opts; // bind |
50 | | - $opts->add( 'page1', '' ); |
51 | | - $opts->add( 'page2', '' ); |
52 | | - $opts->add( 'rev1', '' ); |
53 | | - $opts->add( 'rev2', '' ); |
54 | | - $opts->add( 'action', '' ); |
55 | | - |
56 | | - // Set values |
57 | | - $opts->fetchValuesFromRequest( $wgRequest ); |
58 | | - |
59 | | - $title1 = Title::newFromText( $opts->getValue( 'page1' ) ); |
60 | | - $title2 = Title::newFromText( $opts->getValue( 'page2' ) ); |
61 | | - |
62 | | - if( $title1 && $title1->exists() && $opts->getValue( 'rev1' ) == '' ) { |
63 | | - $pda = new Article( $title1 ); |
64 | | - $pdi = $pda->getID(); |
65 | | - $pdLastRevision = Revision::loadFromPageId( wfGetDB( DB_SLAVE ), $pdi ); |
66 | | - $opts->setValue( 'rev1', $pdLastRevision->getId() ); |
67 | | - } elseif ( $opts->getValue( 'rev1' ) != '' ) { |
68 | | - $pdrev = Revision::newFromId( $opts->getValue( 'rev1' ) ); |
69 | | - if( $pdrev ) $opts->setValue( 'page1', $pdrev->getTitle()->getPrefixedText() ); |
70 | | - } |
71 | | - if( $title2 && $title2->exists() && $opts->getValue( 'rev2' ) == '' ) { |
72 | | - $pda = new Article( $title2 ); |
73 | | - $pdi = $pda->getID(); |
74 | | - $pdLastRevision = Revision::loadFromPageId( wfGetDB( DB_SLAVE ), $pdi ); |
75 | | - $opts->setValue('rev2', $pdLastRevision->getId() ); |
76 | | - } elseif ( $opts->getValue( 'rev2' ) != '' ) { |
77 | | - $pdrev = Revision::newFromId( $opts->getValue( 'rev2' ) ); |
78 | | - if( $pdrev ) $opts->setValue( 'page2', $pdrev->getTitle()->getPrefixedText() ); |
79 | | - } |
80 | | - |
81 | | - // Store some objects |
82 | | - $this->skin = $wgUser->getSkin(); |
83 | | - } |
84 | | - |
85 | 44 | /** |
86 | 45 | * Show a form for filtering namespace and username |
87 | 46 | * |
— | — | @@ -91,80 +50,87 @@ |
92 | 51 | $this->setHeaders(); |
93 | 52 | $this->outputHeader(); |
94 | 53 | |
95 | | - $this->setup( $par ); |
| 54 | + $form = new HTMLForm( array( |
| 55 | + 'Page1' => array( |
| 56 | + 'type' => 'text', |
| 57 | + 'name' => 'page1', |
| 58 | + 'label-message' => 'compare-page1', |
| 59 | + 'size' => '40', |
| 60 | + 'section' => 'page1', |
| 61 | + ), |
| 62 | + 'Revision1' => array( |
| 63 | + 'type' => 'int', |
| 64 | + 'name' => 'rev1', |
| 65 | + 'label-message' => 'compare-rev1', |
| 66 | + 'size' => '8', |
| 67 | + 'section' => 'page1', |
| 68 | + ), |
| 69 | + 'Page2' => array( |
| 70 | + 'type' => 'text', |
| 71 | + 'name' => 'page2', |
| 72 | + 'label-message' => 'compare-page2', |
| 73 | + 'size' => '40', |
| 74 | + 'section' => 'page2', |
| 75 | + ), |
| 76 | + 'Revision2' => array( |
| 77 | + 'type' => 'int', |
| 78 | + 'name' => 'rev2', |
| 79 | + 'label-message' => 'compare-rev2', |
| 80 | + 'size' => '8', |
| 81 | + 'section' => 'page2', |
| 82 | + ), |
| 83 | + 'Action' => array( |
| 84 | + 'type' => 'hidden', |
| 85 | + 'name' => 'action', |
| 86 | + ), |
| 87 | + 'Diffonly' => array( |
| 88 | + 'type' => 'hidden', |
| 89 | + 'name' => 'diffonly', |
| 90 | + ), |
| 91 | + ), 'compare' ); |
| 92 | + $form->setSubmitText( wfMsg( 'compare-submit' ) ); |
| 93 | + $form->suppressReset(); |
| 94 | + $form->setMethod( 'get' ); |
| 95 | + $form->setTitle( $this->getTitle() ); |
96 | 96 | |
97 | | - // Settings |
98 | | - $this->form(); |
| 97 | + $form->loadData(); |
| 98 | + $form->displayForm( '' ); |
99 | 99 | |
100 | | - if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) { |
101 | | - $de = new DifferenceEngine( null, |
102 | | - $this->opts->getValue( 'rev1' ), |
103 | | - $this->opts->getValue( 'rev2' ), |
104 | | - null, // rcid |
105 | | - ( $this->opts->getValue( 'action' ) == 'purge' ), |
106 | | - false ); |
107 | | - $de->showDiffPage( true ); |
108 | | - } |
| 100 | + self::showDiff( $form->mFieldData ); |
109 | 101 | } |
110 | 102 | |
111 | | - protected function form() { |
112 | | - global $wgOut, $wgScript; |
| 103 | + public static function showDiff( $data ){ |
113 | 104 | |
114 | | - // Consume values |
115 | | - $page1 = $this->opts->consumeValue( 'page1' ); |
116 | | - $page2 = $this->opts->consumeValue( 'page2' ); |
117 | | - $rev1 = $this->opts->consumeValue( 'rev1' ); |
118 | | - $rev2 = $this->opts->consumeValue( 'rev2' ); |
| 105 | + if( $data['Revision1'] ){ |
| 106 | + $rev1 = $data['Revision1']; |
| 107 | + } elseif( $data['Page1'] ) { |
| 108 | + $title = Title::newFromText( $data['Page1'] ); |
| 109 | + if( $title instanceof Title ){ |
| 110 | + $rev1 = $title->getLatestRevID(); |
| 111 | + } |
| 112 | + } else { |
| 113 | + $rev1 = null; |
| 114 | + } |
119 | 115 | |
120 | | - // Store query values in hidden fields so that form submission doesn't lose them |
121 | | - $hidden = array(); |
122 | | - foreach ( $this->opts->getUnconsumedValues() as $key => $value ) { |
123 | | - $hidden[] = Html::hidden( $key, $value ); |
| 116 | + if( $data['Revision2'] ){ |
| 117 | + $rev2 = $data['Revision2']; |
| 118 | + } elseif( $data['Page2'] ) { |
| 119 | + $title = Title::newFromText( $data['Page2'] ); |
| 120 | + if( $title instanceof Title ){ |
| 121 | + $rev2 = $title->getLatestRevID(); |
| 122 | + } |
| 123 | + } else { |
| 124 | + $rev2 = null; |
124 | 125 | } |
125 | | - $hidden = implode( "\n", $hidden ); |
126 | 126 | |
127 | | - $form = Html::openElement( 'form', array( 'action' => $wgScript ) ) . |
128 | | - Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . |
129 | | - Xml::fieldset( wfMsg( 'compare-selector' ) ) . |
130 | | - Html::openElement( 'table', array( 'id' => 'mw-diff-table', 'style' => 'width:100%' ) ) . |
131 | | - "<tr> |
132 | | - <td class='mw-label' style='width:10%'>" . |
133 | | - Html::element( 'label', array( 'for' => 'page1' ), wfMsg( 'compare-page1' ) ) . |
134 | | - "</td> |
135 | | - <td class='mw-input' style='width:40%'>" . |
136 | | - Html::input( 'page1', $page1, 'text', array( 'size' => 40, 'id' => 'page1' ) ) . |
137 | | - "</td> |
138 | | - <td class='mw-label' style='width:10%'>" . |
139 | | - Html::element( 'label', array( 'for' => 'page2' ), wfMsg( 'compare-page2' ) ) . |
140 | | - "</td> |
141 | | - <td class='mw-input' style='width:40%'>" . |
142 | | - Html::input( 'page2', $page2, 'text', array( 'size' => 40, 'id' => 'page2' ) ) . |
143 | | - "</td> |
144 | | - </tr>" . |
145 | | - "<tr> |
146 | | - <td class='mw-label'>" . |
147 | | - Html::element( 'label', array( 'for' => 'rev1' ), wfMsg( 'compare-rev1' ) ) . |
148 | | - "</td> |
149 | | - <td class='mw-input'>" . |
150 | | - Html::input( 'rev1', $rev1, 'text', array( 'size' => 8, 'id' => 'rev1' ) ) . |
151 | | - "</td> |
152 | | - <td class='mw-label'>" . |
153 | | - Html::element( 'label', array( 'for' => 'rev2' ), wfMsg( 'compare-rev2' ) ) . |
154 | | - "</td> |
155 | | - <td class='mw-input'>" . |
156 | | - Html::input( 'rev2', $rev2, 'text', array( 'size' => 8, 'id' => 'rev2' ) ) . |
157 | | - "</td> |
158 | | - </tr>" . |
159 | | - "<tr> <td></td> |
160 | | - <td class='mw-submit' colspan='3'>" . |
161 | | - Xml::submitButton( wfMsg( 'compare-submit' ) ) . |
162 | | - "</td> |
163 | | - </tr>" . |
164 | | - Html::closeElement( 'table' ) . |
165 | | - Html::closeElement( 'fieldset' ) . |
166 | | - $hidden . |
167 | | - Html::closeElement( 'form' ); |
168 | | - |
169 | | - $wgOut->addHTML( $form ); |
| 127 | + if( $rev1 && $rev2 ) { |
| 128 | + $de = new DifferenceEngine( null, |
| 129 | + $rev1, |
| 130 | + $rev2, |
| 131 | + null, // rcid |
| 132 | + ( $data["Action"] == 'purge' ), |
| 133 | + false ); |
| 134 | + $de->showDiffPage( true ); |
| 135 | + } |
170 | 136 | } |
171 | 137 | } |
Index: trunk/extensions/BlockTitles/BlockTitles.php |
— | — | @@ -46,8 +46,7 @@ |
47 | 47 | foreach ( $wgBlockTitlePatterns as $re ) { |
48 | 48 | if ( preg_match( $re, $t ) ) { |
49 | 49 | // too bad you can't pass parameter to errorpage |
50 | | - $wgOut->errorpage( 'block_title_error_page_title', 'block_title_error' ); |
51 | | - return false; |
| 50 | + throw new ErrorPageError( 'block_title_error_page_title', 'block_title_error' ); |
52 | 51 | } |
53 | 52 | } |
54 | 53 | |
Index: trunk/extensions/SocialProfile/UserProfile/SpecialPopulateExistingUsersProfiles.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | global $wgRequest, $wgOut, $wgUser; |
31 | 31 | |
32 | 32 | if ( !in_array( 'staff', $wgUser->getEffectiveGroups() ) ) { |
33 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
| 33 | + throw new ErrorPageError( 'error', 'badaccess' ); |
34 | 34 | return ''; |
35 | 35 | } |
36 | 36 | |
Index: trunk/extensions/SocialProfile/UserProfile/SpecialToggleUserPageType.php |
— | — | @@ -29,8 +29,7 @@ |
30 | 30 | |
31 | 31 | // This feature is only available to logged-in users. |
32 | 32 | if ( !$wgUser->isLoggedIn() ) { |
33 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
34 | | - return ''; |
| 33 | + throw new ErrorPageError( 'error', 'badaccess' ); |
35 | 34 | } |
36 | 35 | |
37 | 36 | $dbr = wfGetDB( DB_MASTER ); |
Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php |
— | — | @@ -108,8 +108,7 @@ |
109 | 109 | |
110 | 110 | /** Check if the user is allowed to upload files */ |
111 | 111 | if ( !$wgUser->isAllowed( 'upload' ) ) { |
112 | | - $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' ); |
113 | | - return; |
| 112 | + throw new ErrorPageError( 'uploadnologin', 'uploadnologintext' ); |
114 | 113 | } |
115 | 114 | |
116 | 115 | /** Check if the image directory is writeable, this is a common mistake */ |
— | — | @@ -279,7 +278,7 @@ |
280 | 279 | * is a PHP-managed upload temporary |
281 | 280 | */ |
282 | 281 | function saveUploadedFile( $saveName, $tempName, $ext ) { |
283 | | - global $wgUploadDirectory, $wgOut, $wgUser; |
| 282 | + global $wgUploadDirectory, $wgUser; |
284 | 283 | |
285 | 284 | $dest = $this->avatarUploadDirectory; |
286 | 285 | |
— | — | @@ -344,7 +343,8 @@ |
345 | 344 | } |
346 | 345 | |
347 | 346 | if ( $type < 0 ) { |
348 | | - $wgOut->fileCopyError( $tempName, $stash ); |
| 347 | + # FIXME: undefined variable $stash |
| 348 | + throw new FatalError( wfMsg( 'filecopyerror', $tempName, $stash ) ); |
349 | 349 | } |
350 | 350 | return $type; |
351 | 351 | } |
— | — | @@ -362,12 +362,11 @@ |
363 | 363 | * @access private |
364 | 364 | */ |
365 | 365 | function saveTempUploadedFile( $saveName, $tempName ) { |
366 | | - global $wgOut; |
367 | 366 | $archive = wfImageArchiveDir( $saveName, 'temp' ); |
368 | 367 | $stash = $archive . '/' . gmdate( 'YmdHis' ) . '!' . $saveName; |
369 | 368 | |
370 | 369 | if ( !move_uploaded_file( $tempName, $stash ) ) { |
371 | | - $wgOut->fileCopyError( $tempName, $stash ); |
| 370 | + throw new FatalError( wfMsg( 'filecopyerror', $tempName, $stash ) ); |
372 | 371 | return false; |
373 | 372 | } |
374 | 373 | |
— | — | @@ -410,7 +409,7 @@ |
411 | 410 | $success = unlink( $this->mUploadTempName ); |
412 | 411 | wfRestoreWarnings(); |
413 | 412 | if ( !$success ) { |
414 | | - $wgOut->fileDeleteError( $this->mUploadTempName ); |
| 413 | + throw new FatalError( wfMsg( 'filedeleteerror', $this->mUploadTempName ) ); |
415 | 414 | } |
416 | 415 | } |
417 | 416 | |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialRemoveMasterGift.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | // Check for permissions |
58 | 58 | if ( $wgUser->isAnon() || !$this->canUserManage() ) { |
59 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
| 59 | + throw new ErrorPageError( 'error', 'badaccess' ); |
60 | 60 | } |
61 | 61 | |
62 | 62 | $this->gift_id = $wgRequest->getVal( 'gift_id' ); |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | $wgOut->setPageTitle( wfMsg( 'giftmanager' ) ); |
22 | 22 | |
23 | 23 | if ( $wgUser->isAnon() || !$this->canUserManage() ) { |
24 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
| 24 | + throw new ErrorPageError( 'error', 'badaccess' ); |
25 | 25 | } |
26 | 26 | |
27 | 27 | $wgOut->addStyle( $wgUserGiftsScripts . '/UserGifts.css' ); |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | if ( $gift_id ) { |
143 | 143 | $gift = Gifts::getGift( $gift_id ); |
144 | 144 | if ( $wgUser->getID() != $gift['creator_user_id'] && ( !in_array( 'giftadmin', $wgUser->getGroups() ) && !$wgUser->isAllowed( 'delete' ) ) ) { |
145 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
| 145 | + throw new ErrorPageError( 'error', 'badaccess' ); |
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php |
— | — | @@ -105,8 +105,7 @@ |
106 | 106 | |
107 | 107 | /** Various rights checks */ |
108 | 108 | if ( !$wgUser->isAllowed( 'upload' ) || $wgUser->isBlocked() ) { |
109 | | - $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' ); |
110 | | - return; |
| 109 | + throw new ErrorPageError( 'uploadnologin', 'uploadnologintext' ); |
111 | 110 | } |
112 | 111 | if ( wfReadOnly() ) { |
113 | 112 | $wgOut->readOnlyPage(); |
— | — | @@ -355,7 +354,7 @@ |
356 | 355 | // $sql = "UPDATE user set user_avatar = " . $type . " WHERE user_id = " . $wgUser->mId; |
357 | 356 | // $res = $dbw->query($sql); |
358 | 357 | } else { |
359 | | - $wgOut->fileCopyError( $tempName, $stash ); |
| 358 | + throw new FatalError( wfMsg( 'filecopyerror', $tempName, $stash ) ); # FIXME: undefined variable $stash |
360 | 359 | } |
361 | 360 | return $type; |
362 | 361 | } |
— | — | @@ -373,12 +372,11 @@ |
374 | 373 | * @access private |
375 | 374 | */ |
376 | 375 | function saveTempUploadedFile( $saveName, $tempName ) { |
377 | | - global $wgOut; |
378 | 376 | $archive = wfImageArchiveDir( $saveName, 'temp' ); |
379 | 377 | $stash = $archive . '/' . gmdate( 'YmdHis' ) . '!' . $saveName; |
380 | 378 | |
381 | 379 | if ( !move_uploaded_file( $tempName, $stash ) ) { |
382 | | - $wgOut->fileCopyError( $tempName, $stash ); |
| 380 | + throw new FatalError( wfMsg( 'filecopyerror', $tempName, $stash ) ); |
383 | 381 | return false; |
384 | 382 | } |
385 | 383 | |
— | — | @@ -423,7 +421,7 @@ |
424 | 422 | $success = unlink( $this->mUploadTempName ); |
425 | 423 | wfRestoreWarnings(); |
426 | 424 | if ( !$success ) { |
427 | | - $wgOut->fileDeleteError( $this->mUploadTempName ); |
| 425 | + throw new FatalError( wfMsg( 'filedeleteerror', $this->mUploadTempName ) ); |
428 | 426 | } |
429 | 427 | } |
430 | 428 | |
— | — | @@ -549,7 +547,7 @@ |
550 | 548 | global $wgOut, $wgUser, $wgUseCopyrightUpload; |
551 | 549 | |
552 | 550 | if ( !$this->canUserManage() ) { |
553 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
| 551 | + throw new ErrorPageError( 'error', 'badaccess' ); |
554 | 552 | } |
555 | 553 | |
556 | 554 | $cols = intval( $wgUser->getOption( 'cols' ) ); |
Index: trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php |
— | — | @@ -102,8 +102,7 @@ |
103 | 103 | // Check permissions -- we must be allowed to access this special page |
104 | 104 | // before we can run any database queries |
105 | 105 | if ( !$wgUser->isAllowed( 'updatepoints' ) ) { |
106 | | - $wgOut->errorpage( 'error', 'badaccess' ); |
107 | | - return false; |
| 106 | + throw new ErrorPageError( 'error', 'badaccess' ); |
108 | 107 | } |
109 | 108 | |
110 | 109 | // And obviously the database needs to be writable before we start |
Index: trunk/extensions/RandomInCategory/RandomInCategory.body.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | | - $wgOut->reportTime(); |
| 49 | + wfReportTime(); #FIXME: this does nothing? |
50 | 50 | $wgOut->redirect( $title->getFullUrl() ); |
51 | 51 | } |
52 | 52 | |
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php |
— | — | @@ -312,7 +312,7 @@ |
313 | 313 | if ( $title instanceof Title && $title->exists() && $title->userCanRead() ) { |
314 | 314 | global $wgOut; |
315 | 315 | $revision = Revision::newFromTitle( $title ); |
316 | | - $wgOut->addSecondaryWikiText( $revision->getText() ); |
| 316 | + $wgOut->addWikiText( $revision->getText() ); |
317 | 317 | return true; |
318 | 318 | } else { |
319 | 319 | return false; |
Index: trunk/extensions/Asksql/Asksql_body.php |
— | — | @@ -16,8 +16,7 @@ |
17 | 17 | wfLoadExtensionMessages( 'Asksql' ); |
18 | 18 | |
19 | 19 | if ( !$wgAllowSysopQueries ) { |
20 | | - $wgOut->errorpage( 'nosuchspecialpage', 'nospecialpagetext' ); |
21 | | - return; |
| 20 | + throw new ErrorPageError( 'nosuchspecialpage', 'nospecialpagetext' ); |
22 | 21 | } |
23 | 22 | if ( !$wgUser->isAllowed( 'asksql' ) ) { |
24 | 23 | $wgOut->permissionRequired( 'asksql' ); |
Index: trunk/extensions/DumpHTML/dumpHTML.inc |
— | — | @@ -796,7 +796,7 @@ |
797 | 797 | $ns = $wgTitle->getNamespace(); |
798 | 798 | if ( $ns == NS_SPECIAL ) { |
799 | 799 | $wgOut = new OutputPage; |
800 | | - $wgOut->setParserOptions( new ParserOptions ); |
| 800 | + $wgOut->parserOptions( new ParserOptions ); |
801 | 801 | SpecialPage::executePath( $wgTitle ); |
802 | 802 | } else { |
803 | 803 | /** @todo merge with Wiki.php code */ |
— | — | @@ -812,7 +812,7 @@ |
813 | 813 | return $this->getRedirect( $rt ); |
814 | 814 | } else { |
815 | 815 | $wgOut = new OutputPage; |
816 | | - $wgOut->setParserOptions( new ParserOptions ); |
| 816 | + $wgOut->parserOptions( new ParserOptions ); |
817 | 817 | |
818 | 818 | $wgArticle->view(); |
819 | 819 | } |