From e7c9096ecc084bb81a99d3acc949c32b0ef49d56 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sat, 13 Jun 2015 18:29:15 +0100 Subject: [PATCH] HTTPS-ify links to Wikimedia's sites in MW core source See https://blog.wikimedia.org/2015/06/12/securing-wikimedia-sites-with-https/ Ignoring SVN stuff because svn.wikimedia.org's SSL certificate has expired, and ignoring wgSharedUploadPath because T25122 wants to get rid of it. Also a couple of BZ -> phab changes Change-Id: I02fd23ac6c30a4a4c718e57d4dedbc693dd653c0 --- includes/DefaultSettings.php | 22 +++++++++---------- includes/Preferences.php | 2 +- includes/Setup.php | 4 +--- includes/WebRequest.php | 2 +- includes/filerepo/FileRepo.php | 4 ++-- includes/filerepo/ForeignAPIRepo.php | 4 ++-- .../gallery/PackedOverlayImageGallery.php | 2 +- includes/gallery/TraditionalImageGallery.php | 2 +- includes/installer/LocalSettingsGenerator.php | 2 +- includes/media/FormatMetadata.php | 4 ++-- includes/media/XCF.php | 2 +- .../profiler/output/ProfilerOutputUdp.php | 2 +- includes/specialpage/RedirectSpecialPage.php | 6 ++--- includes/specials/SpecialUploadStash.php | 2 +- 14 files changed, 29 insertions(+), 31 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d278c59539..39f739da56 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -472,13 +472,13 @@ $wgImgAuthUrlPathMap = array(); * * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored * for local repositories: - * - descBaseUrl URL of image description pages, e.g. http://en.wikipedia.org/wiki/File: + * - descBaseUrl URL of image description pages, e.g. https://en.wikipedia.org/wiki/File: * - scriptDirUrl URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g. - * http://en.wikipedia.org/w + * https://en.wikipedia.org/w * - scriptExtension Script extension of the MediaWiki installation, equivalent to * $wgScriptExtension, e.g. .php5 defaults to .php * - * - articleUrl Equivalent to $wgArticlePath, e.g. http://en.wikipedia.org/wiki/$1 + * - articleUrl Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 * - fetchDescription Fetch the text of the remote file description page. Equivalent to * $wgFetchCommonsDescriptions. * - abbrvThreshold File names over this size will use the short form of thumbnail names. @@ -709,7 +709,7 @@ $wgMaxUploadSize = 1024 * 1024 * 100; # 100MB * * @par Example: * @code - * $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload'; + * $wgUploadNavigationUrl = 'https://commons.wikimedia.org/wiki/Special:Upload'; * @endcode */ $wgUploadNavigationUrl = false; @@ -769,7 +769,7 @@ $wgHashedSharedUploadDirectory = true; * * Please specify the namespace, as in the example below. */ -$wgRepositoryBaseUrl = "http://commons.wikimedia.org/wiki/File:"; +$wgRepositoryBaseUrl = "https://commons.wikimedia.org/wiki/File:"; /** * This is the list of preferred extensions for uploading files. Uploading files @@ -2797,14 +2797,14 @@ $wgBrowserBlackList = array( * - Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC) * - [...] * - * @link http://en.wikipedia.org/w/index.php?diff=12356041&oldid=12355864 - * @link http://en.wikipedia.org/wiki/Template%3AOS9 + * @link https://en.wikipedia.org/w/index.php?diff=12356041&oldid=12355864 + * @link https://en.wikipedia.org/wiki/Template%3AOS9 */ '/^Mozilla\/4\.0 \(compatible; MSIE \d+\.\d+; Mac_PowerPC\)/', /** * Google wireless transcoder, seems to eat a lot of chars alive - * http://it.wikipedia.org/w/index.php?title=Luciano_Ligabue&diff=prev&oldid=8857361 + * https://it.wikipedia.org/w/index.php?title=Luciano_Ligabue&diff=prev&oldid=8857361 */ '/^Mozilla\/4\.0 \(compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;\)/' ); @@ -4524,7 +4524,7 @@ $wgUserrightsInterwikiDelimiter = '@'; /** * This is to let user authenticate using https when they come from http. * Based on an idea by George Herbert on wikitech-l: - * http://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html + * https://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html * @since 1.17 */ $wgSecureLogin = false; @@ -5051,7 +5051,7 @@ $wgAccountCreationThrottle = 0; * There's no administrator override on-wiki, so be careful what you set. :) * May be an array of regexes or a single string for backwards compatibility. * - * @see http://en.wikipedia.org/wiki/Regular_expression + * @see https://en.wikipedia.org/wiki/Regular_expression * * @note Each regex needs a beginning/end delimiter, eg: # or / */ @@ -5582,7 +5582,7 @@ $wgProfilePerHost = null; * * The host should be running a daemon which can be obtained from MediaWiki * Git at: - * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile + * https://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile * * @deprecated set $wgProfiler['udphost'] instead */ diff --git a/includes/Preferences.php b/includes/Preferences.php index 9b0ada812a..ecb2294d5b 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1394,7 +1394,7 @@ class Preferences { } # Max is +14:00 and min is -12:00, see: - # http://en.wikipedia.org/wiki/Timezone + # https://en.wikipedia.org/wiki/Timezone $minDiff = min( $minDiff, 840 ); # 14:00 $minDiff = max( $minDiff, - 720 ); # -12:00 return 'Offset|' . $minDiff; diff --git a/includes/Setup.php b/includes/Setup.php index 70c935d37f..8462f68f2e 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -236,9 +236,7 @@ if ( $wgUseInstantCommons ) { $wgForeignFileRepos[] = array( 'class' => 'ForeignAPIRepo', 'name' => 'wikimediacommons', - 'apibase' => WebRequest::detectProtocol() === 'https' ? - 'https://commons.wikimedia.org/w/api.php' : - 'http://commons.wikimedia.org/w/api.php', + 'apibase' => 'https://commons.wikimedia.org/w/api.php', 'hashLevels' => 2, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 6bdcc87186..05e229d0c0 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -691,7 +691,7 @@ class WebRequest { // This shouldn't happen! throw new MWException( "Web server doesn't provide either " . "REQUEST_URI, HTTP_X_ORIGINAL_URL or SCRIPT_NAME. Report details " . - "of your web server configuration to http://bugzilla.wikimedia.org/" ); + "of your web server configuration to https://phabricator.wikimedia.org/" ); } // User-agents should not send a fragment with the URI, but // if they do, and the web server passes it on to us, we diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index c0c6d9d613..e66fdafb40 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -63,7 +63,7 @@ class FileRepo { protected $transformVia404; /** @var string URL of image description pages, e.g. - * http://en.wikipedia.org/wiki/File: + * https://en.wikipedia.org/wiki/File: */ protected $descBaseUrl; @@ -76,7 +76,7 @@ class FileRepo { * to $wgScriptExtension, e.g. .php5 defaults to .php */ protected $scriptExtension; - /** @var string Equivalent to $wgArticlePath, e.g. http://en.wikipedia.org/wiki/$1 */ + /** @var string Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 */ protected $articleUrl; /** @var bool Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE], diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 7ead968fde..c6941e6740 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -29,7 +29,7 @@ * $wgForeignFileRepos[] = array( * 'class' => 'ForeignAPIRepo', * 'name' => 'shared', - * 'apibase' => 'http://en.wikipedia.org/w/api.php', + * 'apibase' => 'https://en.wikipedia.org/w/api.php', * 'fetchDescription' => true, // Optional * 'descriptionCacheExpiry' => 3600, * ); @@ -72,7 +72,7 @@ class ForeignAPIRepo extends FileRepo { global $wgLocalFileRepo; parent::__construct( $info ); - // http://commons.wikimedia.org/w/api.php + // https://commons.wikimedia.org/w/api.php $this->mApiBase = isset( $info['apibase'] ) ? $info['apibase'] : null; if ( isset( $info['apiThumbCacheExpiry'] ) ) { diff --git a/includes/gallery/PackedOverlayImageGallery.php b/includes/gallery/PackedOverlayImageGallery.php index 01360d05fc..e1ee7fafbd 100644 --- a/includes/gallery/PackedOverlayImageGallery.php +++ b/includes/gallery/PackedOverlayImageGallery.php @@ -40,7 +40,7 @@ class PackedOverlayImageGallery extends PackedImageGallery { # ATTENTION: The newline after
is needed to # accommodate htmltidy which in version 4.8.6 generated crackpot HTML - # in its absence, see: http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 + # in its absence, see: https://phabricator.wikimedia.org/T3765 # -Ævar $thumbWidth = $this->getGBWidth( $thumb ) - $this->getThumbPadding() - $this->getGBPadding(); diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index 7a0206c29d..0df6f84635 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -205,7 +205,7 @@ class TraditionalImageGallery extends ImageGalleryBase { protected function wrapGalleryText( $galleryText, $thumb ) { # ATTENTION: The newline after
is needed to # accommodate htmltidy which in version 4.8.6 generated crackpot html in - # its absence, see: http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 + # its absence, see: https://phabricator.wikimedia.org/T3765 # -Ævar return "\n\t\t\t" . '
' . "\n" diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 9bf055c674..7b1cfdcc19 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -371,7 +371,7 @@ ${serverSetting} {$magic}\$wgUseImageMagick = true; {$magic}\$wgImageMagickConvertCommand = \"{$this->values['wgImageMagickConvertCommand']}\"; -# InstantCommons allows wiki to use images from http://commons.wikimedia.org +# InstantCommons allows wiki to use images from https://commons.wikimedia.org \$wgUseInstantCommons = {$this->values['wgUseInstantCommons']}; ## If you use ImageMagick (or any other shell command) on a diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 2ae5af3dfc..8127837419 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -706,7 +706,7 @@ class FormatMetadata extends ContextSource { break; case 'GPSDOP': - // See http://en.wikipedia.org/wiki/Dilution_of_precision_(GPS) + // See https://en.wikipedia.org/wiki/Dilution_of_precision_(GPS) if ( $val <= 2 ) { $val = $this->exifMsg( $tag, 'excellent', $this->formatNum( $val ) ); } elseif ( $val <= 5 ) { @@ -1283,7 +1283,7 @@ class FormatMetadata extends ContextSource { */ private function gcd( $a, $b ) { /* - // http://en.wikipedia.org/wiki/Euclidean_algorithm + // https://en.wikipedia.org/wiki/Euclidean_algorithm // Recursive form would be: if( $b == 0 ) return $a; diff --git a/includes/media/XCF.php b/includes/media/XCF.php index e957cb2891..16e11dc401 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -3,7 +3,7 @@ * Handler for the Gimp's native file format (XCF) * * Overview: - * http://en.wikipedia.org/wiki/XCF_(file_format) + * https://en.wikipedia.org/wiki/XCF_(file_format) * Specification in Gnome repository: * http://svn.gnome.org/viewvc/gimp/trunk/devel-docs/xcf.txt?view=markup * diff --git a/includes/profiler/output/ProfilerOutputUdp.php b/includes/profiler/output/ProfilerOutputUdp.php index 7da03c11f9..a5626779d6 100644 --- a/includes/profiler/output/ProfilerOutputUdp.php +++ b/includes/profiler/output/ProfilerOutputUdp.php @@ -23,7 +23,7 @@ /** * ProfilerSimpleUDP class, that sends out messages for 'udpprofile' daemon - * (see http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile) + * (see https://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile) * * @ingroup Profiler * @since 1.25 diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index df1fa613f3..9129ee5d42 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -149,11 +149,11 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage { * - limit, offset: Useful for linking to history of one's own user page or * user talk page. For example, this would be a link to "the last edit to your * user talk page in the year 2010": - * http://en.wikipedia.org/wiki/Special:MyPage?offset=20110000000000&limit=1&action=history + * https://en.wikipedia.org/wiki/Special:MyPage?offset=20110000000000&limit=1&action=history * * - feed: would allow linking to the current user's RSS feed for their user * talk page: - * http://en.wikipedia.org/w/index.php?title=Special:MyTalk&action=history&feed=rss + * https://en.wikipedia.org/w/index.php?title=Special:MyTalk&action=history&feed=rss * * - preloadtitle: Can be used to provide a default section title for a * preloaded new comment on one's own talk page. @@ -168,7 +168,7 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage { * - redlink: Affects the message the user sees if their talk page/user talk * page does not currently exist. Avoids confusion for newbies with no user * pages over why they got a "permission error" following this link: - * http://en.wikipedia.org/w/index.php?title=Special:MyPage&redlink=1 + * https://en.wikipedia.org/w/index.php?title=Special:MyPage&redlink=1 * * - debug: determines whether the debug parameter is passed to load.php, * which disables reformatting and allows scripts to be debugged. Useful diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 12e103e737..ad329d3e80 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -226,7 +226,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { */ private function outputRemoteScaledThumb( $file, $params, $flags ) { // This option probably looks something like - // 'http://upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use + // '//upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use // trailing slash. $scalerBaseUrl = $this->getConfig()->get( 'UploadStashScalerBaseUrl' ); -- 2.20.1