Skip to content

Commit

Permalink
Update market.class.php
Browse files Browse the repository at this point in the history
Fix of downloading commercial plugins.
  • Loading branch information
sergejey committed May 24, 2023
1 parent 527f397 commit 68c988e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/market/market.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ function downloadPlugin($url, $filename, $frame = 0)
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FILE, $f);

if (preg_match('/market/\?op=download/', $url)) {
if (preg_match('/\?op=download/', $url)) {
DebMes("Setting CONNECT authorization credentials", 'market');
@include_once(DIR_MODULES . 'connect/connect.class.php');
if (class_exists('connect')) {
$connect = new connect();
Expand All @@ -977,14 +978,17 @@ function downloadPlugin($url, $filename, $frame = 0)
if ($connect_username != '' && $connect_password != '') {
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $connect_username . ":" . $connect_password);
DebMes("Auth credentials set.", 'market');
} else {
DebMes("Auth credentials missing.", 'market');
}
}
}
$incoming = curl_exec($ch);
curl_close($ch);
@fclose($f);

if (filesize($filename)>0) {
if (filesize($filename) > 0) {
if ($frame) {
$this->echonow("OK<br/>", 'green');
}
Expand Down

0 comments on commit 68c988e

Please sign in to comment.