Merge white label fix

This commit is contained in:
Hillel Coren 2017-03-21 15:42:12 +02:00
parent ccb87c8d60
commit 754f11cb51
2 changed files with 12 additions and 10 deletions

View File

@ -41,15 +41,17 @@ class SaveClientPortalSettings extends Request
$input['client_view_css'] = HTMLUtils::sanitize($this->client_view_css); $input['client_view_css'] = HTMLUtils::sanitize($this->client_view_css);
} }
if ($this->custom_link == 'subdomain') { if (Utils::isNinja()) {
$subdomain = substr(strtolower($input['subdomain']), 0, MAX_SUBDOMAIN_LENGTH); if ($this->custom_link == 'subdomain') {
$input['subdomain'] = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', $subdomain); $subdomain = substr(strtolower($input['subdomain']), 0, MAX_SUBDOMAIN_LENGTH);
$input['iframe_url'] = null; $input['subdomain'] = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', $subdomain);
} else { $input['iframe_url'] = null;
$iframeURL = substr(strtolower($input['iframe_url']), 0, MAX_IFRAME_URL_LENGTH); } else {
$iframeURL = preg_replace('/[^a-zA-Z0-9_\-\:\/\.]/', '', $iframeURL); $iframeURL = substr(strtolower($input['iframe_url']), 0, MAX_IFRAME_URL_LENGTH);
$input['iframe_url'] = rtrim($iframeURL, '/'); $iframeURL = preg_replace('/[^a-zA-Z0-9_\-\:\/\.]/', '', $iframeURL);
$input['subdomain'] = null; $input['iframe_url'] = rtrim($iframeURL, '/');
$input['subdomain'] = null;
}
} }
$this->replace($input); $this->replace($input);

View File

@ -84,7 +84,7 @@
} }
function buyProduct(affiliateKey, productId) { function buyProduct(affiliateKey, productId) {
window.open('{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/buy_now/?account_key=AsFmBAeLXF0IKf7tmi0eiyZfmWW9hxMT&product_id=' + productId + '&contact_key={{ Auth::user()->primaryAccount()->account_key }}' + '&redirect_url=' + window.location); window.open('{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/buy_now/?account_key={{ NINJA_LICENSE_ACCOUNT_KEY }}&product_id=' + productId + '&contact_key={{ Auth::user()->primaryAccount()->account_key }}' + '&redirect_url=' + window.location.href);
} }
function showApplyLicense() { function showApplyLicense() {