Merge pull request #4286 from gregory-p/wordpress

Wordpress
This commit is contained in:
gregory-p
2020-09-24 11:34:35 +03:00
committed by GitHub

View File

@@ -208,12 +208,16 @@ function get_lawcarta_url(){
if (defined('LAWCARTA_SUBDOMAIN')) { if (defined('LAWCARTA_SUBDOMAIN')) {
$hostParts = explode('.', $host); $hostParts = explode('.', $host);
if (count($hostParts) === 3) { if (count($hostParts) === 3) {
array_shift($hostParts); $wp_sub_domain = array_shift($hostParts);
} }
if (!empty(LAWCARTA_SUBDOMAIN)) { if (!empty(LAWCARTA_SUBDOMAIN)) {
array_unshift($hostParts, LAWCARTA_SUBDOMAIN); array_unshift($hostParts, LAWCARTA_SUBDOMAIN);
} }
$host = implode('.', $hostParts); $host = implode('.', $hostParts);
//Fix for staging env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){
$host = str_replace('staging-law', 'staging-live',$host);
}
} }
$port = isset($urlParts['port']) ? $urlParts['port'] : ''; $port = isset($urlParts['port']) ? $urlParts['port'] : '';