jenkins-bot has submitted this change and it was merged.
Change subject: Remove classes and functions deprecated in MediaWiki 1.17
......................................................................
Remove classes and functions deprecated in MediaWiki 1.17
Removed classes:
- WikiError (deprecated in 1.17)
- WikiXmlError (deprecated in 1.17)
- WikiErrorMsg (deprecated in 1.17)
Removed methods:
- ApiBase::getValidNamespaces() (deprecated in 1.17)
- ApiMain::setCachePrivate() (deprecated in 1.17)
- ApiMain::setVaryCookie (deprecated in 1.17)
- CategoryViewer::addSubcategory() (deprecated in 1.17)
- WebRequest::getFileSize() (deprecated in 1.17)
- WebRequest::isPathInfoBad() (deprecated in 1.17)
Change-Id: Id715c2391742c136d09f5369f88d67e798842af7
---
M RELEASE-NOTES-1.23
M includes/AutoLoader.php
M includes/CategoryViewer.php
M includes/WebRequest.php
D includes/WikiError.php
M includes/api/ApiBase.php
M includes/api/ApiMain.php
7 files changed, 11 insertions(+), 254 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 2a0f673..bcf9daf 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -143,8 +143,11 @@
SpecialPage::getPageTitle.
==== Removed classes ====
-* TitleDependency
-* TitleListDependency
+* TitleDependency (unused)
+* TitleListDependency (unused)
+* WikiError (deprecated in 1.17)
+* WikiXmlError (deprecated in 1.17)
+* WikiErrorMsg (deprecated in 1.17)
==== Renamed classes ====
* CdbReader_DBA to CdbReaderDBA
@@ -176,6 +179,10 @@
* wikiStatsOutput to WikiStatsOutput
==== Removed methods ====
+* ApiBase::getValidNamespaces() (deprecated in 1.17)
+* ApiMain::setCachePrivate() (deprecated in 1.17)
+* ApiMain::setVaryCookie (deprecated in 1.17)
+* CategoryViewer::addSubcategory() (deprecated in 1.17)
* EditPage::spamPage() (deprecated since 1.17)
* Exif::getFormattedData() (deprecated in 1.18)
* Exif::makeFormattedData() (deprecated in 1.18)
@@ -214,6 +221,8 @@
* SpecialRecentChanges::feedSetup()
* SpecialRevisionDelete::extractBitField() (deprecated in 1.22)
* User::getPageRenderingHash() (deprecated in 1.17)
+* WebRequest::getFileSize() (deprecated in 1.17)
+* WebRequest::isPathInfoBad() (deprecated in 1.17)
* WikiPage::quickEdit() (deprecated in 1.18)
* WikiPage::useParserCache() (deprecated in 1.18)
* WikiPage::viewUpdates() (deprecated in 1.18)
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index a9b0376..1c37c77 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -234,8 +234,6 @@
'WebRequestUpload' => 'includes/WebRequest.php',
'WebResponse' => 'includes/WebResponse.php',
'WikiCategoryPage' => 'includes/WikiCategoryPage.php',
- 'WikiError' => 'includes/WikiError.php',
- 'WikiErrorMsg' => 'includes/WikiError.php',
'WikiExporter' => 'includes/Export.php',
'WikiFilePage' => 'includes/WikiFilePage.php',
'WikiImporter' => 'includes/Import.php',
@@ -243,7 +241,6 @@
'WikiRevision' => 'includes/Import.php',
'WikiMap' => 'includes/WikiMap.php',
'WikiReference' => 'includes/WikiMap.php',
- 'WikiXmlError' => 'includes/WikiError.php',
'Xml' => 'includes/Xml.php',
'XmlDumpWriter' => 'includes/Export.php',
'XmlJsCode' => 'includes/Xml.php',
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 55d9c1e..4027bef 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -182,15 +182,6 @@
}
/**
- * Add a subcategory to the internal lists, using a title object
- * @deprecated since 1.17 kept for compatibility, use
addSubcategoryObject instead
- */
- function addSubcategory( Title $title, $sortkey, $pageLength ) {
- wfDeprecated( __METHOD__, '1.17' );
- $this->addSubcategoryObject( Category::newFromTitle( $title ),
$sortkey, $pageLength );
- }
-
- /**
* Get the character to be used for sorting subcategories.
* If there's a link from Category:A to Category:B, the sortkey of the
resulting
* entry in the categorylinks table is Category:A, not A, which it
SHOULD be.
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 2a7c032..85c8bb6 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -836,19 +836,6 @@
}
/**
- * Return the size of the upload, or 0.
- *
- * @deprecated since 1.17
- * @param $key String:
- * @return integer
- */
- public function getFileSize( $key ) {
- wfDeprecated( __METHOD__, '1.17' );
- $file = new WebRequestUpload( $this, $key );
- return $file->getSize();
- }
-
- /**
* Return the upload error or 0
*
* @param $key String:
@@ -1033,35 +1020,6 @@
HTML;
echo "\n";
return true;
- }
-
- /**
- * Returns true if the PATH_INFO ends with an extension other than a
script
- * extension. This could confuse IE for scripts that send arbitrary
data which
- * is not HTML but may be detected as such.
- *
- * Various past attempts to use the URL to make this check have
generally
- * run up against the fact that CGI does not provide a standard method
to
- * determine the URL. PATH_INFO may be mangled (e.g. if
cgi.fix_pathinfo=0),
- * but only by prefixing it with the script name and maybe some other
stuff,
- * the extension is not mangled. So this should be a reasonably portable
- * way to perform this security check.
- *
- * Also checks for anything that looks like a file extension at the end
of
- * QUERY_STRING, since IE 6 and earlier will use this to get the file
type
- * if there was no dot before the question mark (bug 28235).
- *
- * @deprecated Use checkUrlExtension().
- *
- * @param $extWhitelist array
- *
- * @return bool
- */
- public function isPathInfoBad( $extWhitelist = array() ) {
- wfDeprecated( __METHOD__, '1.17' );
- global $wgScriptExtension;
- $extWhitelist[] = ltrim( $wgScriptExtension, '.' );
- return IEUrlExtension::areServerVarsBad( $_SERVER,
$extWhitelist );
}
/**
@@ -1460,14 +1418,6 @@
*/
public function getSessionArray() {
return $this->session;
- }
-
- /**
- * @param array $extWhitelist
- * @return bool
- */
- public function isPathInfoBad( $extWhitelist = array() ) {
- return false;
}
/**
diff --git a/includes/WikiError.php b/includes/WikiError.php
deleted file mode 100644
index 08eb800..0000000
--- a/includes/WikiError.php
+++ /dev/null
@@ -1,154 +0,0 @@
-<?php
-/**
- * MediaWiki error classes
- *
- * Copyright © 2005 Brion Vibber <[email protected]>
- * http://www.mediawiki.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-/**
- * Since PHP4 doesn't have exceptions, here's some error objects
- * loosely modeled on the standard PEAR_Error model...
- * @ingroup Exception
- */
-class WikiError {
- /**
- * @param $message string
- *
- * @deprecated since 1.17
- */
- function __construct( $message ) {
- wfDeprecated( __METHOD__, '1.17' );
- $this->mMessage = $message;
- }
-
- /**
- * @return string Plaintext error message to display
- */
- function getMessage() {
- return $this->mMessage;
- }
-
- /**
- * In following PEAR_Error model this could be formatted differently,
- * but so far it's not.
- * @return string
- */
- function toString() {
- return $this->getMessage();
- }
-
- /**
- * Returns true if the given object is a WikiError-descended
- * error object, false otherwise.
- *
- * @param $object mixed
- * @return bool
- *
- * @deprecated since 1.17
- */
- public static function isError( $object ) {
- wfDeprecated( __METHOD__, '1.17' );
- if ( $object instanceof WikiError ) {
- return true;
- } elseif ( $object instanceof Status ) {
- return !$object->isOK();
- } else {
- return false;
- }
- }
-}
-
-/**
- * Localized error message object
- * @ingroup Exception
- */
-class WikiErrorMsg extends WikiError {
- /**
- * @param string $message wiki message name
- * @param ... parameters to pass to wfMsg()
- *
- * @deprecated since 1.17
- */
- function __construct( $message/*, ... */ ) {
- wfDeprecated( __METHOD__, '1.17' );
- $args = func_get_args();
- array_shift( $args );
- $this->mMessage = wfMessage( $message )->rawParams( $args
)->text();
- $this->mMsgKey = $message;
- $this->mMsgArgs = $args;
- }
-
- function getMessageKey() {
- return $this->mMsgKey;
- }
-
- function getMessageArgs() {
- return $this->mMsgArgs;
- }
-}
-
-/**
- * Error class designed to handle errors involved with
- * XML parsing
- * @ingroup Exception
- */
-class WikiXmlError extends WikiError {
- /**
- * @param $parser resource
- * @param $message string
- * @param $context
- * @param $offset Int
- *
- * @deprecated since 1.17
- */
- function __construct( $parser, $message = 'XML parsing error', $context
= null, $offset = 0 ) {
- wfDeprecated( __METHOD__, '1.17' );
- $this->mXmlError = xml_get_error_code( $parser );
- $this->mColumn = xml_get_current_column_number( $parser );
- $this->mLine = xml_get_current_line_number( $parser );
- $this->mByte = xml_get_current_byte_index( $parser );
- $this->mContext = $this->_extractContext( $context, $offset );
- $this->mMessage = $message;
- xml_parser_free( $parser );
- wfDebug( "WikiXmlError: " . $this->getMessage() . "\n" );
- }
-
- /** @return string */
- function getMessage() {
- // '$1 at line $2, col $3 (byte $4): $5',
- return wfMessage( 'xml-error-string',
- $this->mMessage,
- $this->mLine,
- $this->mColumn,
- $this->mByte . $this->mContext,
- xml_error_string( $this->mXmlError ) )->escaped();
- }
-
- function _extractContext( $context, $offset ) {
- if ( is_null( $context ) ) {
- return null;
- } else {
- // Hopefully integer overflow will be handled
transparently here
- $inlineOffset = $this->mByte - $offset;
- return '; "' . substr( $context, $inlineOffset, 16 ) .
'"';
- }
- }
-}
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index b6a7ca8..40edf4e 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -862,17 +862,6 @@
}
/**
- * @deprecated since 1.17 use MWNamespace::getValidNamespaces()
- *
- * @return array
- */
- public static function getValidNamespaces() {
- wfDeprecated( __METHOD__, '1.17' );
-
- return MWNamespace::getValidNamespaces();
- }
-
- /**
* Return true if we're to watch the page, false if not, null if no
change.
* @param string $watchlist Valid values: 'watch', 'unwatch',
'preferences', 'nochange'
* @param $titleObj Title the page under consideration
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 829ba6f..5735b76 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -293,16 +293,6 @@
}
/**
- * @deprecated since 1.17 Private caching is now the default, so there
is usually no
- * need to call this function. If there is a need, you can use
- * $this->setCacheMode('private')
- */
- public function setCachePrivate() {
- wfDeprecated( __METHOD__, '1.17' );
- $this->setCacheMode( 'private' );
- }
-
- /**
* Set directives (key/value pairs) for the Cache-Control header.
* Boolean values will be formatted as such, by including or omitting
* without an equals sign.
@@ -314,21 +304,6 @@
*/
public function setCacheControl( $directives ) {
$this->mCacheControl = $directives + $this->mCacheControl;
- }
-
- /**
- * Make sure Vary: Cookie and friends are set. Use this when the output
of a request
- * may be cached for anons but may not be cached for logged-in users.
- *
- * WARNING: This function must be called CONSISTENTLY for a given URL.
This means that a
- * given URL must either always or never call this function; if it
sometimes does and
- * sometimes doesn't, stuff will break.
- *
- * @deprecated since 1.17 Use setCacheMode( 'anon-public-user-private' )
- */
- public function setVaryCookie() {
- wfDeprecated( __METHOD__, '1.17' );
- $this->setCacheMode( 'anon-public-user-private' );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/104156
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id715c2391742c136d09f5369f88d67e798842af7
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits