diff options
author | Peter Zhang <peter@innocraft.com> | 2022-07-25 03:07:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 03:07:27 +0300 |
commit | 797b60687a65040b87d4c9cd459a3163ab13d1d8 (patch) | |
tree | e516c13454a1489ede7b4492e7a1fd2c12e6bde7 /plugins/Marketplace | |
parent | ca1b52a5e0113ce40f172ae337e93f86e1c8d831 (diff) |
Update HTTPs security check, when client is using HTTP just throw a warning on diagnostic (#19527)
* default Matomo request to http
default Matomo request to http
* Update HttpsUpdateCheck.php
update checks
* Update plugins/Marketplace/config/config.php
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* update lang and links
update lang and links
* Update config.php
update phpcs
* Update config.php
update checks
* Update plugins/Installation/lang/en.json
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update Client.php
revert code style changes
* update checks and changes
update checks and changes
* Update UIIntegrationTest_admin_diagnostics_configfile.png
update screenshots
* Update plugins/Installation/lang/en.json
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* Update HttpsUpdateCheck.php
update link
* Update config/global.ini.php
* update https to http as default
update https to http as default
* Update plugins/Installation/lang/en.json
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* remove https
remove https
* Update config.php
fix phpcs
* remove translations
remove translations
* remove comma
* Update en.json
update lang
* Update UIIntegrationTest_admin_diagnostics_configfile.png
update ui
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Marketplace')
-rw-r--r-- | plugins/Marketplace/Api/Client.php | 17 | ||||
-rw-r--r-- | plugins/Marketplace/config/config.php | 9 |
2 files changed, 7 insertions, 19 deletions
diff --git a/plugins/Marketplace/Api/Client.php b/plugins/Marketplace/Api/Client.php index 5e81b6c982..7e6404c0f7 100644 --- a/plugins/Marketplace/Api/Client.php +++ b/plugins/Marketplace/Api/Client.php @@ -6,6 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ + namespace Piwik\Plugins\Marketplace\Api; use Exception as PhpException; @@ -168,7 +169,7 @@ class Client $pluginName = $plugin->getPluginName(); if (!$this->pluginManager->isPluginBundledWithCore($pluginName)) { $isActivated = $this->pluginManager->isPluginActivated($pluginName); - $params[] = array('name' => $plugin->getPluginName(), 'version' => $plugin->getVersion(), 'activated' => (int) $isActivated); + $params[] = array('name' => $plugin->getPluginName(), 'version' => $plugin->getVersion(), 'activated' => (int)$isActivated); } } @@ -189,7 +190,7 @@ class Client } /** - * @param \Piwik\Plugin[] $plugins + * @param \Piwik\Plugin[] $plugins * @return array */ public function getInfoOfPluginsHavingUpdate($plugins) @@ -214,7 +215,6 @@ class Client $plugin['repositoryChangelogUrl'] = $pluginHavingUpdate['repositoryChangelogUrl']; $pluginDetails[] = $plugin; } - } return $pluginDetails; @@ -268,7 +268,7 @@ class Client $params['release_channel'] = $releaseChannel; } - $params['prefer_stable'] = (int) $this->environment->doesPreferStable(); + $params['prefer_stable'] = (int)$this->environment->doesPreferStable(); $params['piwik'] = $this->environment->getPiwikVersion(); $params['php'] = $this->environment->getPhpVersion(); $params['mysql'] = $this->environment->getMySQLVersion(); @@ -309,8 +309,8 @@ class Client /** * @param $pluginOrThemeName - * @throws Exception * @return string + * @throws Exception */ public function getDownloadUrl($pluginOrThemeName) { @@ -332,12 +332,7 @@ class Client */ public static function getApiServiceUrl() { - $url = GeneralConfig::getConfigValue('api_service_url'); - if (!GeneralConfig::getConfigValue('force_matomo_ssl_request')) { - $url = str_replace('https', 'http', $url); - } - - return $url; + return GeneralConfig::getConfigValue('api_service_url'); } } diff --git a/plugins/Marketplace/config/config.php b/plugins/Marketplace/config/config.php index 1ebe26f698..0cfce1bb5d 100644 --- a/plugins/Marketplace/config/config.php +++ b/plugins/Marketplace/config/config.php @@ -1,19 +1,12 @@ <?php -use Piwik\Config\GeneralConfig; use Piwik\Plugins\Marketplace\Api\Service; use Piwik\Plugins\Marketplace\LicenseKey; use Psr\Container\ContainerInterface; return array( 'MarketplaceEndpoint' => function (ContainerInterface $c) { - $domain = 'https://plugins.matomo.org'; - - if (GeneralConfig::getConfigValue('force_matomo_ssl_request') === 0) { - $domain = str_replace('https://', 'http://', $domain); - } - - return $domain; + return 'http://plugins.matomo.org'; }, 'Piwik\Plugins\Marketplace\Api\Service' => function (ContainerInterface $c) { /** @var \Piwik\Plugins\Marketplace\Api\Service $previous */ |