Merge "Disambiguate buildForm docs, add TODO"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 13 May 2013 18:25:35 +0000 (18:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 13 May 2013 18:25:35 +0000 (18:25 +0000)
RELEASE-NOTES-1.22
includes/DefaultSettings.php
maintenance/copyFileBackend.php

index ad12bf9..569a2b9 100644 (file)
@@ -16,6 +16,8 @@ production.
   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.
index 46ca7ed..bcc4ae4 100644 (file)
@@ -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 <link ... href="urn:...">s
+       'geo:', // geo: urls define locations, they're useful in Microdata/RDFa and when mentioning coordinates.
        '//', // for protocol-relative URLs
 );
 
index 685c868..fddc72c 100644 (file)
@@ -158,6 +158,7 @@ class CopyFileBackend extends Maintenance {
                $ops = array();
                $fsFiles = array();
                $copiedRel = array(); // for output message
+               $wikiId = $src->getWikiId();
 
                // Download the batch of source files into backend cache...
                if ( $this->hasOption( 'missingonly' ) ) {
@@ -177,7 +178,7 @@ class CopyFileBackend extends Maintenance {
                        $srcPath = $src->getRootStoragePath() . "/$backendRel/$srcPathRel";
                        $dstPath = $dst->getRootStoragePath() . "/$backendRel/$srcPathRel";
                        if ( $this->hasOption( 'utf8only' ) && !mb_check_encoding( $srcPath, 'UTF-8' ) ) {
-                               $this->error( "Detected illegal (non-UTF8) path for $srcPath." );
+                               $this->error( "$wikiId: Detected illegal (non-UTF8) path for $srcPath." );
                                continue;
                        } elseif ( !$this->hasOption( 'missingonly' )
                                && $this->filesAreSame( $src, $dst, $srcPath, $dstPath ) )
@@ -190,17 +191,17 @@ class CopyFileBackend extends Maintenance {
                                : $src->getLocalReference( array( 'src' => $srcPath, 'latest' => 1 ) );
                        if ( !$fsFile ) {
                                if ( $src->fileExists( array( 'src' => $srcPath ) ) === false ) {
-                                       $this->error( "File '$srcPath' was listed but must have been deleted." );
+                                       $this->error( "$wikiId: File '$srcPath' was listed but does not exist." );
                                        continue;
                                } else {
-                                       $this->error( "Could not get local copy of $srcPath." );
+                                       $this->error( "$wikiId: Could not get local copy of $srcPath." );
                                }
                                continue;
                        } elseif ( !$fsFile->exists() ) {
                                // FSFileBackends just return the path for getLocalReference() and paths with
                                // illegal slashes may get normalized to a different path. This can cause the
                                // local reference to not exist...skip these broken files.
-                               $this->error( "Detected possible illegal path for $srcPath." );
+                               $this->error( "$wikiId: Detected possible illegal path for $srcPath." );
                                continue;
                        }
                        $fsFiles[] = $fsFile; // keep TempFSFile objects alive as needed
@@ -208,7 +209,7 @@ class CopyFileBackend extends Maintenance {
                        $status = $dst->prepare( array( 'dir' => dirname( $dstPath ), 'bypassReadOnly' => 1 ) );
                        if ( !$status->isOK() ) {
                                $this->error( print_r( $status->getErrorsArray(), true ) );
-                               $this->error( "Could not copy $srcPath to $dstPath.", 1 ); // die
+                               $this->error( "$wikiId: Could not copy $srcPath to $dstPath.", 1 ); // die
                        }
                        $ops[] = array( 'op' => 'store',
                                'src' => $fsFile->getPath(), 'dst' => $dstPath, 'overwrite' => 1 );
@@ -225,7 +226,7 @@ class CopyFileBackend extends Maintenance {
                $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
                if ( !$status->isOK() ) {
                        $this->error( print_r( $status->getErrorsArray(), true ) );
-                       $this->error( "Could not copy file batch.", 1 ); // die
+                       $this->error( "$wikiId: Could not copy file batch.", 1 ); // die
                } elseif ( count( $copiedRel ) ) {
                        $this->output( "\nCopied these file(s) [{$ellapsed_ms}ms]:\n" .
                                implode( "\n", $copiedRel ) . "\n\n" );