From: jenkins-bot Date: Wed, 15 May 2013 08:24:06 +0000 (+0000) Subject: Merge "Fix inconsistent docs" X-Git-Tag: 1.31.0-rc.0~19674 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=f3de84430d8e569d9de9302f1855139edb28df03;hp=c4e951d32efa4ad84e1a414b0f4ce158aca810f8;p=lhc%2Fweb%2Fwiklou.git Merge "Fix inconsistent docs" --- diff --git a/CREDITS b/CREDITS index 6cc28c19ca..417bec3bc1 100644 --- a/CREDITS +++ b/CREDITS @@ -160,7 +160,7 @@ following names for their contribution to the product. * Manuel Menal * Marcin Cieślak * Marcus Buck -* Mark A. Pelletier +* Marc-André Pelletier * Mark Hershberger * Mark Holmquist * Marooned diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 50444a7a13..6b66ce0870 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -15,6 +15,9 @@ production. activated; when $wgUseVFormCreateAccount is true, the redesign of Special:UserLogin/signup is activated. * $wgVectorUseIconWatch is now enabled by default. +* $wgCascadingRestrictionLevels was added. +* ftps, ssh, sftp, xmpp, sip, sips, tel, sms, bitcoin, magnet, urn, and geo + have been whitelisted inside of $wgUrlProtocols. === New features in 1.22 === * (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes. @@ -67,10 +70,12 @@ production. * mediawiki.log: Added log.warn wrapper (uses console.warn and console.trace). * mediawiki.log: Implemented log.deprecate. This method defines a property and uses ES5 getter/setter to emit a warning when they are used. +* $wgCascadingRestrictionLevels was added, allowing one to specify restriction levels + which can be cascading (previously 'sysop' was hard-coded as the only one). === Bug fixes in 1.22 === -* Disable Special:PasswordReset when $wgEnableEmail. Previously one could still - navigate to the page by entering the URL directly. +* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one + could still navigate to the page by entering the URL directly. * (bug 47138) Fixed a fatal error when a blocked user tries to automatically create an account on login due external authentication in some circumstances. * (bug 23393) HTML headings containing line breaks are now handled @@ -88,6 +93,7 @@ production. * A bias in wfRandomString() toward digits 1-7 has been corrected. Generated strings will now start with digits 0 and 8-f as often as they should. * (bug 45371) Removed Parser_LinkHooks and CoreLinkFunctions classes. +* (bug 41545) Allow , , and to be nested like allowed in html. === API changes in 1.22 === * (bug 46626) xmldoublequote parameter was removed. Because of a bug, the @@ -110,6 +116,8 @@ production. * (bug 47219) Allow specifying change type of Wikipedia feed items * prop=imageinfo now allows setting iiurlheight without setting iiurlwidth * prop=info now adds the content model of the title. +* New upload log entries will now contain information on the relavent + image (sha1 and timestamp). === Languages updated in 1.22=== diff --git a/api.php b/api.php index b9efe2c252..9d7f6480ed 100644 --- a/api.php +++ b/api.php @@ -54,8 +54,8 @@ if ( !$wgRequest->checkUrlExtension() ) { // Verify that the API has not been disabled if ( !$wgEnableAPI ) { header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); - echo( 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' - . '
$wgEnableAPI=true;
' ); + echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' + . '
$wgEnableAPI=true;
'; die( 1 ); } diff --git a/docs/maintenance.txt b/docs/maintenance.txt index 27619c8622..87a32a8037 100644 --- a/docs/maintenance.txt +++ b/docs/maintenance.txt @@ -34,7 +34,7 @@ In it, write the following: fetchContentObject(); - $this->mContent = ContentHandler::getContentText( $content ); #@todo: get rid of mContent everywhere! + // @todo Get rid of mContent everywhere! + $this->mContent = ContentHandler::getContentText( $content ); ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) ); wfProfileOut( __METHOD__ ); @@ -787,7 +788,7 @@ class Article implements Page { * Show a diff page according to current request variables. For use within * Article::view() only, other callers should use the DifferenceEngine class. * - * @todo: make protected + * @todo Make protected */ public function showDiffPage() { $request = $this->getContext()->getRequest(); diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 7b25db82d4..26d5b94c9c 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -1148,7 +1148,7 @@ class AutoLoader { $filename = "$IP/$filename"; } - require( $filename ); + require $filename; return true; } diff --git a/includes/Block.php b/includes/Block.php index 47ddc7d8f2..d2f430ed8b 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -683,7 +683,7 @@ class Block { if ( $ipblock ) { # Check if the block is an autoblock and would exceed the user block # if renewed. If so, do nothing, otherwise prolong the block time... - if ( $ipblock->mAuto && // @TODO: why not compare $ipblock->mExpiry? + if ( $ipblock->mAuto && // @todo Why not compare $ipblock->mExpiry? $this->mExpiry > Block::getAutoblockExpiry( $ipblock->mTimestamp ) ) { # Reset block timestamp to now and its expiry to diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 407ac8f839..296b71d1a2 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -496,11 +496,11 @@ $wgFileBackends = array(); $wgLockManagers = array(); /** - * Show EXIF data, on by default if available. - * Requires PHP's EXIF extension: http://www.php.net/manual/en/ref.exif.php + * Show Exif data, on by default if available. + * Requires PHP's Exif extension: http://www.php.net/manual/en/ref.exif.php * * @note FOR WINDOWS USERS: - * To enable EXIF functions, add the following lines to the "Windows + * To enable Exif functions, add the following lines to the "Windows * extensions" section of php.ini: * @code{.ini} * extension=extensions/php_mbstring.dll @@ -848,7 +848,7 @@ $wgJpegTran = '/usr/bin/jpegtran'; /** - * Some tests and extensions use exiv2 to manipulate the EXIF metadata in some + * Some tests and extensions use exiv2 to manipulate the Exif metadata in some * image formats. */ $wgExiv2Command = '/usr/bin/exiv2'; @@ -3377,17 +3377,29 @@ $wgUrlProtocols = array( 'http://', 'https://', 'ftp://', + 'ftps://', // If we allow ftp:// we should allow the secure version. + 'ssh://', + 'sftp://', // SFTP > FTP 'irc://', 'ircs://', // @bug 28503 + 'xmpp:', // Another open communication protocol + 'sip:', + 'sips:', 'gopher://', 'telnet://', // Well if we're going to support the above.. -ævar 'nntp://', // @bug 3808 RFC 1738 'worldwind://', 'mailto:', + 'tel:', // If we can make emails linkable, why not phone numbers? + 'sms:', // Likewise this is standardized too 'news:', 'svn://', 'git://', 'mms://', + 'bitcoin:', // Even registerProtocolHandler whitelists this along with mailto: + 'magnet:', // No reason to reject torrents over magnet: when they're allowed over http:// + 'urn:', // Allow URNs to be used in Microdata/RDFa s + 'geo:', // geo: urls define locations, they're useful in Microdata/RDFa and when mentioning coordinates. '//', // for protocol-relative URLs ); @@ -4044,6 +4056,21 @@ $wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload' ); */ $wgRestrictionLevels = array( '', 'autoconfirmed', 'sysop' ); +/** + * Restriction levels that can be used with cascading protection + * + * A page can only be protected with cascading protection if the + * requested restriction level is included in this array. + * + * This is intended to prevent abuse - if any protection could be + * cascading, users could who cannot normally protect pages could + * "protect" them by transcluding them on protected pages they are + * allowed to edit. + * + * 'sysop' is quietly rewritten to 'protect' for backwards compatibility. + */ +$wgCascadingRestrictionLevels = array( 'sysop' ); + /** * Set the minimum permissions required to edit pages in each * namespace. If you list more than one permission, a user must @@ -5777,7 +5804,7 @@ $wgDisableQueryPageUpdate = false; * List of special pages, followed by what subtitle they should go under * at Special:SpecialPages * - * @deprecated 1.21 Override SpecialPage::getGroupName instead + * @deprecated since 1.21 Override SpecialPage::getGroupName instead */ $wgSpecialPageGroups = array(); @@ -6304,7 +6331,7 @@ $wgContentHandlerUseDB = true; * of texts are also rendered as wikitext, it only means that links, magic words, etc will have * the effect on the database they would have on a wikitext page. * - * @todo: On the long run, it would be nice to put categories etc into a separate structure, + * @todo On the long run, it would be nice to put categories etc into a separate structure, * or at least parse only the contents of comments in the scripts. * * @since 1.21 diff --git a/includes/EditPage.php b/includes/EditPage.php index c97431a0d8..27f4556bf7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2138,7 +2138,7 @@ class EditPage { } } - //@todo: add EditForm plugin interface and use it here! + // @todo add EditForm plugin interface and use it here! // search for textarea1 and textares2, and allow EditForm to override all uses. $wgOut->addHTML( Html::openElement( 'form', array( 'id' => self::EDITFORM_ID, 'name' => self::EDITFORM_ID, 'method' => 'post', 'action' => $this->getActionURL( $this->getContextTitle() ), diff --git a/includes/Exception.php b/includes/Exception.php index c513ef7dbe..dc1208a0d1 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -668,7 +668,7 @@ class MWExceptionHandler { if ( defined( 'STDERR' ) ) { fwrite( STDERR, $message ); } else { - echo( $message ); + echo $message; } } diff --git a/includes/Export.php b/includes/Export.php index e533dbc732..a26e853eff 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -689,7 +689,7 @@ class XmlDumpWriter { $content_model = strval( $row->rev_content_model ); } else { // probably using $wgContentHandlerUseDB = false; - // @todo: test! + // @todo test! $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $content_model = ContentHandler::getDefaultModelFor( $title ); } @@ -700,7 +700,7 @@ class XmlDumpWriter { $content_format = strval( $row->rev_content_format ); } else { // probably using $wgContentHandlerUseDB = false; - // @todo: test! + // @todo test! $content_handler = ContentHandler::getForModelID( $content_model ); $content_format = $content_handler->getDefaultFormat(); } diff --git a/includes/HashRing.php b/includes/HashRing.php index 227a287de8..73a38af949 100644 --- a/includes/HashRing.php +++ b/includes/HashRing.php @@ -36,8 +36,8 @@ class HashRing { * @param array $map (location => weight) */ public function __construct( array $map ) { - $sum = array_sum( $map ); - if ( !count( $map ) || $sum <= 0 ) { + $map = array_filter( $map, function( $w ) { return $w > 0; } ); + if ( !count( $map ) ) { throw new MWException( "Ring is empty or all weights are zero." ); } // Sort the locations based on the hash of their names diff --git a/includes/ImagePage.php b/includes/ImagePage.php index e6870465d9..a5beb5d983 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -250,7 +250,7 @@ class ImagePage extends Article { * * @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata(). * - * @param array $metadata the array containing the EXIF data + * @param array $metadata the array containing the Exif data * @return String The metadata table. This is treated as Wikitext (!) */ protected function makeMetadataTable( $metadata ) { diff --git a/includes/Import.php b/includes/Import.php index 7b078dbf10..8b7af02a0f 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -428,11 +428,11 @@ class WikiImporter { } } - print( var_dump( + print var_dump( $lookup[$this->reader->nodeType], $this->reader->name, $this->reader->value - ) . "\n\n" ); + ) . "\n\n"; } /** diff --git a/includes/Linker.php b/includes/Linker.php index 4003efb30b..3529d28b50 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1740,7 +1740,7 @@ class Linker { */ public static function makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor = false ) { $ret = "$html " + . "$html" . $link . ""; if ( $legacyAnchor !== false ) { diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 8c6d762341..4b1b5b888c 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -27,7 +27,7 @@ */ class LinksUpdate extends SqlDataUpdate { - // @todo: make members protected, but make sure extensions don't break + // @todo make members protected, but make sure extensions don't break public $mId, //!< Page ID of the article linked from $mTitle, //!< Title object of the article linked from diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4a2b17a380..2c9a081a25 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1296,7 +1296,6 @@ class OutputPage extends ContextSource { * Return whether user JavaScript is allowed for this page * @deprecated since 1.18 Load modules with ResourceLoader, and origin and * trustworthiness is identified and enforced automagically. - * Will be removed in 1.20. * @return Boolean */ public function isUserJsAllowed() { @@ -2076,7 +2075,7 @@ class OutputPage extends ContextSource { } /** - * Actually output something with print(). + * Actually output something with print. * * @param string $ins the string to output */ @@ -2968,7 +2967,7 @@ $templates // This also enforces $.isReady to be true at which fixes the // mw.loader bug in Firefox with using document.write between // and the DOMContentReady event (bug 47457). - $html = Html::inlineScript( 'jQuery.ready();' ); + $html = Html::inlineScript( 'window.jQuery && jQuery.ready();' ); if ( !$wgResourceLoaderExperimentalAsyncLoading ) { $html .= $this->getScriptsForBottomQueue( false ); diff --git a/includes/PHPVersionError.php b/includes/PHPVersionError.php index e8ecf6dbf4..c9321f00ff 100644 --- a/includes/PHPVersionError.php +++ b/includes/PHPVersionError.php @@ -112,6 +112,6 @@ HTML; $finalOutput = ( $type == 'load.php' ) ? "/* $message */" : $message; header( "$protocol 500 MediaWiki configuration Error" ); } - echo( "$finalOutput\n" ); + echo "$finalOutput\n"; die( 1 ); } diff --git a/includes/Preferences.php b/includes/Preferences.php index 0d765fa56b..bb386f2a4c 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -409,8 +409,8 @@ class Preferences { $disableEmailPrefs = false; - $emailauthenticationclass = 'mw-email-not-authenticated'; if ( $wgEmailAuthentication ) { + $emailauthenticationclass = 'mw-email-not-authenticated'; if ( $user->getEmail() ) { if ( $user->getEmailAuthenticationTimestamp() ) { // date and time are separate parameters to facilitate localisation. @@ -449,8 +449,8 @@ class Preferences { # Apply the same CSS class used on the input to the message: 'cssclass' => $emailauthenticationclass, ); + $defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass; } - $defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass; if ( $wgEnableUserEmail && $user->isAllowed( 'sendemail' ) ) { $defaultPreferences['disablemail'] = array( @@ -1476,7 +1476,7 @@ class Preferences { } /** - * @deprecated in 1.19; will be removed in 1.20. + * @deprecated in 1.19 * @param $user User * @return array */ diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 9439b90c92..0871cf0edc 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -614,16 +614,9 @@ class ProtectionForm { } function buildCleanupScript() { - global $wgRestrictionLevels, $wgOut; + global $wgCascadingRestrictionLevels, $wgOut; - $cascadeableLevels = array(); - foreach ( $wgRestrictionLevels as $key ) { - if ( User::groupHasPermission( $key, 'protect' ) - || $key == 'protect' - ) { - $cascadeableLevels[] = $key; - } - } + $cascadeableLevels = $wgCascadingRestrictionLevels; $options = array( 'tableId' => 'mwProtectSet', 'labelText' => wfMessage( 'protect-unchain-permissions' )->plain(), diff --git a/includes/Revision.php b/includes/Revision.php index 1a7d825003..47626a22b3 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -560,7 +560,7 @@ class Revision implements IDBAccessObject { # if we have a content object, use it to set the model and type if ( !empty( $row['content'] ) ) { - //@todo: when is that set? test with external store setup! check out insertOn() [dk] + // @todo when is that set? test with external store setup! check out insertOn() [dk] if ( !empty( $row['text_id'] ) ) { throw new MWException( "Text already stored in external store (id {$row['text_id']}), " . "can't serialize content object" ); @@ -918,7 +918,7 @@ class Revision implements IDBAccessObject { * to the $audience parameter * * @deprecated in 1.21, use getContent() instead - * @todo: replace usage in core + * @todo Replace usage in core * @return String */ public function getText( $audience = self::FOR_PUBLIC, User $user = null ) { diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index e757021ef8..099d0afb53 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -399,7 +399,8 @@ class Sanitizer { } $htmlnest = array( # Tags that can be nested--?? 'table', 'tr', 'td', 'th', 'div', 'blockquote', 'ol', 'ul', - 'li', 'dl', 'dt', 'dd', 'font', 'big', 'small', 'sub', 'sup', 'span' + 'li', 'dl', 'dt', 'dd', 'font', 'big', 'small', 'sub', 'sup', 'span', + 'var', 'kbd', 'samp' ); $tabletags = array( # Can only appear inside table, we will close them 'td', 'th', 'tr', diff --git a/includes/SeleniumWebSettings.php b/includes/SeleniumWebSettings.php index 26c2df54a4..2fcbe65f6d 100644 --- a/includes/SeleniumWebSettings.php +++ b/includes/SeleniumWebSettings.php @@ -27,7 +27,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { die( 1 ); } -require_once( "$IP/includes/GlobalFunctions.php" ); +require_once "$IP/includes/GlobalFunctions.php"; $fname = 'SeleniumWebSettings.php'; wfProfileIn( $fname ); @@ -120,7 +120,7 @@ if ( isset( $_COOKIE[$cookieName] ) ) { } foreach ( $testIncludes as $includeFile ) { $file = $IP . '/' . $includeFile; - require_once( $file ); + require_once $file; } foreach ( $testGlobalConfigs as $key => $value ) { if ( is_array( $value ) ) { diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 66bc9eeedf..02e1911d6d 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -258,7 +258,7 @@ class SiteStatsUpdate implements DeferrableUpdate { protected $users = 0; protected $images = 0; - // @TODO: deprecate this constructor + // @todo deprecate this constructor function __construct( $views, $edits, $good, $pages = 0, $users = 0 ) { $this->views = $views; $this->edits = $edits; diff --git a/includes/Skin.php b/includes/Skin.php index ca7a91b833..245fac2a59 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -164,7 +164,7 @@ abstract class Skin extends ContextSource { # Grab the skin class and initialise it. if ( !class_exists( $className ) ) { - require_once( "{$wgStyleDirectory}/{$skinName}.php" ); + require_once "{$wgStyleDirectory}/{$skinName}.php"; # Check if we got if not fallback to default skin if ( !class_exists( $className ) ) { @@ -174,7 +174,7 @@ abstract class Skin extends ContextSource { # is no longer valid. wfDebug( "Skin class does not exist: $className\n" ); $className = 'SkinVector'; - require_once( "{$wgStyleDirectory}/Vector.php" ); + require_once "{$wgStyleDirectory}/Vector.php"; } } $skin = new $className( $key ); diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index c2814e6309..38448cd32b 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -676,7 +676,7 @@ class SpecialPage { $func = $this->mFunction; // only load file if the function does not exist if ( !is_callable( $func ) && $this->mFile ) { - require_once( $this->mFile ); + require_once $this->mFile; } $this->outputHeader(); call_user_func( $func, $subPage, $this ); @@ -797,7 +797,7 @@ class SpecialPage { /** * Shortcut to get user's language * - * @deprecated 1.19 Use getLanguage instead + * @deprecated since 1.19 Use getLanguage instead * @return Language * @since 1.18 */ diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 3c4e61d00b..4d635536a7 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -287,7 +287,7 @@ class SpecialPageFactory { * * @param $page Mixed: SpecialPage or string * @param $group String - * @deprecated 1.21 Override SpecialPage::getGroupName + * @deprecated since 1.21 Override SpecialPage::getGroupName */ public static function setGroup( $page, $group ) { wfDeprecated( __METHOD__, '1.21' ); @@ -302,7 +302,7 @@ class SpecialPageFactory { * * @param $page SpecialPage * @return String - * @deprecated 1.21 Use SpecialPage::getFinalGroupName + * @deprecated since 1.21 Use SpecialPage::getFinalGroupName */ public static function getGroup( &$page ) { wfDeprecated( __METHOD__, '1.21' ); diff --git a/includes/SqlDataUpdate.php b/includes/SqlDataUpdate.php index 79dcdc5918..51188d85c9 100644 --- a/includes/SqlDataUpdate.php +++ b/includes/SqlDataUpdate.php @@ -56,7 +56,7 @@ abstract class SqlDataUpdate extends DataUpdate { $this->mOptions = array( 'FOR UPDATE' ); } - // @todo: get connection only when it's needed? make sure that doesn't break anything, especially transactions! + // @todo get connection only when it's needed? make sure that doesn't break anything, especially transactions! $this->mDb = wfGetDB( DB_MASTER ); $this->mWithTransaction = $withTransaction; diff --git a/includes/Status.php b/includes/Status.php index 64a3c60f26..f0253df483 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -234,7 +234,7 @@ class Status { * * @note: this does not perform a full wikitext to HTML conversion, it merely applies * a message transformation. - * @todo: figure out whether that is actually The Right Thing. + * @todo figure out whether that is actually The Right Thing. */ public function getHTML( $shortContext = false, $longContext = false ) { $text = $this->getWikiText( $shortContext, $longContext ); diff --git a/includes/Title.php b/includes/Title.php index 70e8cd442f..14915e58ed 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -944,7 +944,7 @@ class Title { * @return Bool */ public function isConversionTable() { - //@todo: ConversionTable should become a separate content model. + // @todo ConversionTable should become a separate content model. return $this->getNamespace() == NS_MEDIAWIKI && strpos( $this->getText(), 'Conversiontable/' ) === 0; @@ -2242,7 +2242,7 @@ class Title { * Protect css subpages of user pages: can $wgUser edit * this page? * - * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. + * @deprecated in 1.19; use getUserPermissionsErrors() instead. * @return Bool */ public function userCanEditCssSubpage() { @@ -2256,7 +2256,7 @@ class Title { * Protect js subpages of user pages: can $wgUser edit * this page? * - * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. + * @deprecated in 1.19; use getUserPermissionsErrors() instead. * @return Bool */ public function userCanEditJsSubpage() { @@ -2349,7 +2349,7 @@ class Title { /** * Update the title protection status * - * @deprecated in 1.19; will be removed in 1.20. Use WikiPage::doUpdateRestrictions() instead. + * @deprecated in 1.19; use WikiPage::doUpdateRestrictions() instead. * @param $create_perm String Permission required for creation * @param string $reason Reason for protection * @param string $expiry Expiry timestamp diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 370bac9fe3..e48070aa04 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -260,7 +260,7 @@ class UserMailer { wfDebug( "PEAR Mail_Mime package is not installed. Falling back to text email.\n" ); } else { - require_once( 'Mail/mime.php' ); + require_once 'Mail/mime.php'; if ( wfIsWindows() ) { $body['text'] = str_replace( "\n", "\r\n", $body['text'] ); $body['html'] = str_replace( "\n", "\r\n", $body['html'] ); @@ -300,7 +300,7 @@ class UserMailer { if ( !stream_resolve_include_path( 'Mail.php' ) ) { throw new MWException( 'PEAR mail package is not installed' ); } - require_once( 'Mail.php' ); + require_once 'Mail.php'; wfSuppressWarnings(); diff --git a/includes/WebStart.php b/includes/WebStart.php index bfa3c7118c..ead6d77ae6 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -92,27 +92,27 @@ if ( $IP === false ) { } # Get MWInit class -require_once( "$IP/includes/Init.php" ); +require_once "$IP/includes/Init.php"; # Start the autoloader, so that extensions can derive classes from core files -require_once( "$IP/includes/AutoLoader.php" ); +require_once "$IP/includes/AutoLoader.php"; # Load the profiler -require_once( "$IP/includes/profiler/Profiler.php" ); +require_once "$IP/includes/profiler/Profiler.php"; # Load up some global defines. -require_once( "$IP/includes/Defines.php" ); +require_once "$IP/includes/Defines.php"; # Start the profiler $wgProfiler = array(); if ( file_exists( "$IP/StartProfiler.php" ) ) { - require( "$IP/StartProfiler.php" ); + require "$IP/StartProfiler.php"; } wfProfileIn( 'WebStart.php-conf' ); # Load default settings -require_once( "$IP/includes/DefaultSettings.php" ); +require_once "$IP/includes/DefaultSettings.php"; if ( defined( 'MW_CONFIG_CALLBACK' ) ) { # Use a callback function to configure MediaWiki @@ -126,16 +126,16 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) { # the wiki installer needs to be launched or the generated file uploaded to # the root wiki directory if ( !file_exists( MW_CONFIG_FILE ) ) { - require_once( "$IP/includes/templates/NoLocalSettings.php" ); + require_once "$IP/includes/templates/NoLocalSettings.php"; die(); } # Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked) - require_once( MW_CONFIG_FILE ); + require_once MW_CONFIG_FILE; } if ( $wgEnableSelenium ) { - require_once( "$IP/includes/SeleniumWebSettings.php" ); + require_once "$IP/includes/SeleniumWebSettings.php"; } wfProfileOut( 'WebStart.php-conf' ); @@ -146,11 +146,11 @@ wfProfileIn( 'WebStart.php-ob_start' ); # that would cause us to potentially mix gzip and non-gzip output, creating a # big mess. if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ob_get_level() == 0 ) { - require_once( "$IP/includes/OutputHandler.php" ); + require_once "$IP/includes/OutputHandler.php"; ob_start( 'wfOutputHandler' ); } wfProfileOut( 'WebStart.php-ob_start' ); if ( !defined( 'MW_NO_SETUP' ) ) { - require_once( "$IP/includes/Setup.php" ); + require_once "$IP/includes/Setup.php"; } diff --git a/includes/WikiPage.php b/includes/WikiPage.php index f2c9c298d3..b8f4911a6f 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -187,7 +187,7 @@ class WikiPage implements Page, IDBAccessObject { * (and only when) $wgActions[$action] === true. This allows subclasses * to override the default behavior. * - * @todo: move this UI stuff somewhere else + * @todo Move this UI stuff somewhere else * * @return Array */ @@ -648,7 +648,7 @@ class WikiPage implements Page, IDBAccessObject { * @return String|false The text of the current revision * @deprecated as of 1.21, getContent() should be used instead. */ - public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo: deprecated, replace usage! + public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo deprecated, replace usage! ContentHandler::deprecated( __METHOD__, '1.21' ); $this->loadLastEdit(); @@ -1175,7 +1175,7 @@ class WikiPage implements Page, IDBAccessObject { } if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { - // @todo: move this logic to MessageCache + // @todo move this logic to MessageCache if ( $this->exists() ) { // NOTE: use transclusion text for messages. @@ -1459,8 +1459,8 @@ class WikiPage implements Page, IDBAccessObject { * * @return boolean whether sections are supported. * - * @todo: the skin should check this and not offer section functionality if sections are not supported. - * @todo: the EditPage should check this and not offer section functionality if sections are not supported. + * @todo The skin should check this and not offer section functionality if sections are not supported. + * @todo The EditPage should check this and not offer section functionality if sections are not supported. */ public function supportsSections() { return $this->getContentHandler()->supportsSections(); @@ -1956,7 +1956,7 @@ class WikiPage implements Page, IDBAccessObject { $options = $this->getContentHandler()->makeParserOptions( $context ); if ( $this->getTitle()->isConversionTable() ) { - //@todo: ConversionTable should become a separate content model, so we don't need special cases like this one. + // @todo ConversionTable should become a separate content model, so we don't need special cases like this one. $options->disableContentConversion(); } @@ -2110,7 +2110,7 @@ class WikiPage implements Page, IDBAccessObject { DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, $good, $total ) ); DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content->getTextForSearchIndex() ) ); - // @TODO: let the search engine decide what to do with the content object + // @todo let the search engine decide what to do with the content object // If this is another user's talk page, update newtalk. // Don't do this if $options['changed'] = false (null-edits) nor if @@ -2221,7 +2221,7 @@ class WikiPage implements Page, IDBAccessObject { * @return Status */ public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, $reason, User $user ) { - global $wgContLang; + global $wgContLang, $wgCascadingRestrictionLevels; if ( wfReadOnly() ) { return Status::newFatal( 'readonlytext', wfReadOnlyReason() ); @@ -2344,12 +2344,17 @@ class WikiPage implements Page, IDBAccessObject { return Status::newGood(); } - // Only restrictions with the 'protect' right can cascade... - // Otherwise, people who cannot normally protect can "protect" pages via transclusion + // Only certain restrictions can cascade... Otherwise, users who cannot normally protect pages + // could "protect" them by transcluding them on protected pages they are allowed to edit. $editrestriction = isset( $limit['edit'] ) ? array( $limit['edit'] ) : $this->mTitle->getRestrictions( 'edit' ); + $cascadingRestrictionLevels = $wgCascadingRestrictionLevels; + if ( in_array( 'sysop', $cascadingRestrictionLevels ) ) { + $cascadingRestrictionLevels[] = 'protect'; // backwards compatibility + } + // The schema allows multiple restrictions - if ( !in_array( 'protect', $editrestriction ) && !in_array( 'sysop', $editrestriction ) ) { + if ( !array_intersect( $editrestriction, $cascadingRestrictionLevels ) ) { $cascade = false; } @@ -2668,7 +2673,7 @@ class WikiPage implements Page, IDBAccessObject { * performs permissions checks on $user, then calls commitRollback() * to do the dirty work * - * @todo: separate the business/permission stuff out from backend code + * @todo Separate the business/permission stuff out from backend code * * @param string $fromP Name of the user whose edits to rollback. * @param string $summary Custom summary. Set to default summary if empty. @@ -2936,7 +2941,7 @@ class WikiPage implements Page, IDBAccessObject { * Purge caches on page update etc * * @param $title Title object - * @todo: verify that $title is always a Title object (and never false or null), add Title hint to parameter $title + * @todo Verify that $title is always a Title object (and never false or null), add Title hint to parameter $title */ public static function onArticleEdit( $title ) { // Invalidate caches of articles which include this page @@ -3398,7 +3403,7 @@ class PoolWorkArticleView extends PoolCounterWork { function doWork() { global $wgUseFileCache; - // @todo: several of the methods called on $this->page are not declared in Page, but present + // @todo several of the methods called on $this->page are not declared in Page, but present // in WikiPage and delegated by Article. $isCurrent = $this->revid === $this->page->getLatest(); diff --git a/includes/Xml.php b/includes/Xml.php index c62cbdf635..3eedeb20b5 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -739,8 +739,8 @@ class Xml { /** * Generate a form (without the opening form element). * Output optionally includes a submit button. - * @param array $fields Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input. - * @param string $submitLabel A message containing a label for the submit button. + * @param array $fields Associative array, key is the name of a message that contains a description for the field, value is an HTML string containing the appropriate input. + * @param string $submitLabel The name of a message containing a label for the submit button. * @return string HTML form. */ public static function buildForm( $fields, $submitLabel = null ) { @@ -750,6 +750,11 @@ class Xml { foreach ( $fields as $labelmsg => $input ) { $id = "mw-$labelmsg"; $form .= Xml::openElement( 'tr', array( 'id' => $id ) ); + + // TODO use a