diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 1caf7779c..999a9843f 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -848,16 +848,14 @@ Utils.createCommand = function (oContext, fExecute, fCanExecute) { var - fResult = fExecute ? function () { - + fNonEmpty = function () { if (fResult && fResult.canExecute && fResult.canExecute()) { fExecute.apply(oContext, Array.prototype.slice.call(arguments)); } - return false; - - } : function () {} + }, + fResult = fExecute ? fNonEmpty : Utils.emptyFunction; ; fResult.enabled = ko.observable(true); diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php index 267544707..6e9c5d311 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Http.php @@ -522,11 +522,12 @@ class Http * @param string $sProxy = '' * @param string $sProxyAuth = '' * @param array $aHttpHeaders = array() + * @param bool $bFollowLocation = true * * @return bool */ public function SaveUrlToFile($sUrl, $rFile, $sCustomUserAgent = 'MailSo Http User Agent (v1)', &$sContentType = '', &$iCode = 0, - $oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array()) + $oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array(), $bFollowLocation = true) { if (null === $sCustomUserAgent) { @@ -549,7 +550,7 @@ class Http CURLOPT_FAILONERROR => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_RETURNTRANSFER => true, - CURLOPT_FOLLOWLOCATION => true, + CURLOPT_FOLLOWLOCATION => !!$bFollowLocation, CURLOPT_MAXREDIRS => 7, CURLOPT_FILE => $rFile, CURLOPT_TIMEOUT => (int) $iTimeout @@ -620,14 +621,15 @@ class Http * @param string $sProxy = '' * @param string $sProxyAuth = '' * @param array $aHttpHeaders = array() + * @param bool $bFollowLocation = true * * @return string|bool */ public function GetUrlAsString($sUrl, $sCustomUserAgent = 'MailSo Http User Agent (v1)', &$sContentType = '', &$iCode = 0, - $oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array()) + $oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array(), $bFollowLocation = true) { $rMemFile = \MailSo\Base\ResourceRegistry::CreateMemoryResource(); - if ($this->SaveUrlToFile($sUrl, $rMemFile, $sCustomUserAgent, $sContentType, $iCode, $oLogger, $iTimeout, $sProxy, $sProxyAuth, $aHttpHeaders) && \is_resource($rMemFile)) + if ($this->SaveUrlToFile($sUrl, $rMemFile, $sCustomUserAgent, $sContentType, $iCode, $oLogger, $iTimeout, $sProxy, $sProxyAuth, $aHttpHeaders, $bFollowLocation) && \is_resource($rMemFile)) { \rewind($rMemFile); return \stream_get_contents($rMemFile); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 70a7bc4b0..d25db3623 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -2529,7 +2529,9 @@ class Actions $sValue = $oHttp->GetUrlAsString(APP_API_PATH.'status/'.\urlencode($sDomain), 'RainLoop', $sContentType, $iCode, $this->Logger(), 10, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')); + $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''), + array(), false + ); if (200 !== $iCode) { @@ -2599,7 +2601,9 @@ class Actions \sleep(1); $sValue = $oHttp->GetUrlAsString(APP_API_PATH.'activate/'.\urlencode($sDomain).'/'.\urlencode($sKey), 'RainLoop', $sContentType, $iCode, $this->Logger(), 10, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')); + $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''), + array(), false + ); if (200 !== $iCode) {