Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
fix fclose error on failed connection
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg authored and fritzmg committed Apr 3, 2017
1 parent f41c5e4 commit cfdbae5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions check/controller/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ protected function canInstall()
public function canConnect()
{
$connection = @fsockopen('ssl://download.contao.org', 443, $errno, $errstr, 10);
$connected = ($connection !== false);
fclose($connection);

if ($connected) {
if ($connection !== false) {
fclose($connection);
return true;
}

Expand Down
5 changes: 2 additions & 3 deletions check/controller/live-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ public function isFastCgiEaccelerator()
public function canConnect()
{
$connection = @fsockopen('ssl://update.contao.org', 443, $errno, $errstr, 10);
$connected = ($connection !== false);
fclose($connection);

if ($connected) {
if ($connection !== false) {
fclose($connection);
return true;
}

Expand Down
5 changes: 2 additions & 3 deletions check/controller/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ public function hasSsl()
public function canConnect()
{
$connection = @fsockopen('ssl://contao.org', 443, $errno, $errstr, 10);
$connected = ($connection !== false);
fclose($connection);

if ($connected) {
if ($connection !== false) {
fclose($connection);
return true;
}

Expand Down

0 comments on commit cfdbae5

Please sign in to comment.