mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SecureLinkFixer
synced 2024-11-13 18:27:04 +00:00
fee7ab5a42
composer: * mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0 * php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0 npm: * grunt: 1.3.0 → 1.4.0 * lodash: 4.17.19 → 4.17.21 * https://npmjs.com/advisories/1673 (CVE-2021-23337) Change-Id: I65eb5506046363d6e8afcaf3166a5f153865121a
46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Copyright (C) 2018-2019 Kunal Mehta <legoktm@debian.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 3 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, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
namespace MediaWiki\SecureLinkFixer;
|
|
|
|
$IP = getenv( 'MW_INSTALL_PATH' );
|
|
if ( $IP === false ) {
|
|
$IP = __DIR__ . '/../../..';
|
|
}
|
|
|
|
require_once "$IP/includes/libs/StaticArrayWriter.php";
|
|
require_once __DIR__ . '/../includes/ListFetcher.php';
|
|
|
|
/**
|
|
* Downloads Mozilla's HSTS preload list and builds it into a PHP file.
|
|
*
|
|
* We explicitly don't use Maintenance here so that this script
|
|
* can be run without needing all of MediaWiki to be installed.
|
|
*/
|
|
function main() {
|
|
$lf = new ListFetcher( static function ( $text ) {
|
|
echo $text;
|
|
} );
|
|
[ $rev, $date ] = $lf->getLatestInfo();
|
|
$code = $lf->fetchList( $rev, $date );
|
|
file_put_contents( __DIR__ . '/../domains.php', $code );
|
|
echo "Updated domains.php\n";
|
|
}
|
|
|
|
main();
|