diff options
author | nashe <thomas@chauchefoin.fr> | 2017-07-13 13:04:28 +0100 |
---|---|---|
committer | nashe <thomas@chauchefoin.fr> | 2017-07-13 13:04:28 +0100 |
commit | 8406cec349ca59a62004efe3bc01124a609219fa (patch) | |
tree | 8e5d30a7217da0f23cd372da2adf3fb940885c46 | |
parent | 6f3a001bfa95b1a0ee3ecc867d1ab8a52051b014 (diff) | |
download | planet-8406cec349ca59a62004efe3bc01124a609219fa.tar planet-8406cec349ca59a62004efe3bc01124a609219fa.tar.gz planet-8406cec349ca59a62004efe3bc01124a609219fa.tar.bz2 planet-8406cec349ca59a62004efe3bc01124a609219fa.tar.xz planet-8406cec349ca59a62004efe3bc01124a609219fa.zip |
Add an option to disable feed certificate check
-rw-r--r-- | README.markdown | 1 | ||||
-rwxr-xr-x | admin/subscriptions.php | 6 | ||||
-rw-r--r-- | app/classes/Planet.php | 7 | ||||
-rw-r--r-- | app/classes/PlanetConfig.php | 3 | ||||
-rwxr-xr-x | install.php | 3 |
5 files changed, 18 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown index 747bea4..afa443e 100644 --- a/README.markdown +++ b/README.markdown @@ -63,6 +63,7 @@ nohtml: 0 # deprecated categories: # only list posts that have one # of these (tag or category) debug: false # debug mode (dangerous in production!) +checkcerts: true # check feeds certificates ``` --- diff --git a/admin/subscriptions.php b/admin/subscriptions.php index 1a79d1b..f8e4c2c 100755 --- a/admin/subscriptions.php +++ b/admin/subscriptions.php @@ -44,6 +44,12 @@ if (isset($_POST['opml']) || isset($_POST['add'])) { $feed = new SimplePie(); $feed->enable_cache(false); $feed->set_feed_url($_POST['url']); + if ($conf['checkcerts'] === false) { + $feed->set_curl_options([ + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_SSL_VERIFYPEER => false + ]); + } $feed->init(); $feed->handle_content_type(); $person['name'] = html_entity_decode($feed->get_title()); diff --git a/app/classes/Planet.php b/app/classes/Planet.php index aa323ee..39b55f6 100644 --- a/app/classes/Planet.php +++ b/app/classes/Planet.php @@ -181,6 +181,13 @@ class Planet $this->errors[] = new PlanetError(1, 'Forced from cache : '.$feed->getFeed()); } + if ($this->config->checkcerts === false) { + $feed->set_curl_options([ + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_SSL_VERIFYPEER => false + ]); + } + //Load feed $feed->init(); $isDown = ''; diff --git a/app/classes/PlanetConfig.php b/app/classes/PlanetConfig.php index 4838ba0..4348524 100644 --- a/app/classes/PlanetConfig.php +++ b/app/classes/PlanetConfig.php @@ -20,7 +20,8 @@ class PlanetConfig 'postmaxlength' => 0, 'categories' => '', 'cachedir' => './cache', - 'debug' => false + 'debug' => false, + 'checkcerts' => true, ); /** diff --git a/install.php b/install.php index 07437d3..2c417d5 100755 --- a/install.php +++ b/install.php @@ -33,7 +33,8 @@ if (file_exists(__DIR__ . '/custom/config.yml') && isset($login) && isset($passw 'nohtml' => 0, 'postmaxlength' => 0, 'cachedir' => './cache', - 'debug' => false + 'debug' => false, + 'checkcerts' => true, ); $CreatePlanetConfig = new PlanetConfig($config); |