protected function getRedirectUrl($url) { $redirect_url = parse_url($url); if (!is_array($redirect_url)) { return; } if (array_key_exists('host', $redirect_url) && !$this->getDi()->config->get('other_domains_redirect')) { $match = false; foreach (array(ROOT_URL, ROOT_SURL) as $u) { $amember_url = parse_url($u); if (Am_License::getMinDomain($amember_url['host']) == Am_License::getMinDomain($redirect_url['host'])) { $match = true; } } } else { $match = true; } if ($match) { return $url; } }
public function setSessionCookieDomain() { if (ini_get('session.cookie_domain') != '') { return; } // already configured $domain = @$_SERVER['HTTP_HOST']; $domain = strtolower(trim(preg_replace('/(\\:\\d+)$/', '', $domain))); if (!$domain) { return; } if ($domain == 'localhost') { return; } if (preg_match('/\\.(dev|local)$/', $domain)) { @ini_set('session.cookie_domain', ".{$domain}"); return; } /* * If domain is valid IP address do not change session.cookie_domain; */ if (filter_var($domain, FILTER_VALIDATE_IP)) { return $domain; } try { $min = Am_License::getMinDomain($domain); } catch (Exception $e) { return; } @ini_set('session.cookie_domain', ".{$min}"); }
public function setSessionCookieDomain() { if (ini_get('session.cookie_domain') != '') { return; } // already configured $domain = @$_SERVER['HTTP_HOST']; $domain = strtolower(trim(preg_replace('/(\\:\\d+)$/', '', $domain))); if (!$domain) { return; } if ($domain == 'localhost') { return $domain; } if (preg_match('/\\.(dev|local)$/', $domain)) { return $domain; } try { $min = Am_License::getMinDomain($domain); } catch (Exception $e) { return; } @ini_set('session.cookie_domain', ".{$min}"); }
private static function _getCookieDomain($d) { if ($d === null || $d == 'localhost') { return null; } if (preg_match('/\\.(dev|local)$/', $d)) { return null; } try { $d = '.' . Am_License::getMinDomain($d); } catch (Exception $e) { } return $d; }
private static function _getCookieDomain($d) { if ($d === null) { return null; } $d = strtolower(trim(preg_replace('/(\\:\\d+)$/', '', $d))); if ($d == 'localhost') { return null; } if (preg_match('/\\.(dev|local)$/', $d)) { return null; } if (filter_var($d, FILTER_VALIDATE_IP)) { return null; } try { $d = '.' . Am_License::getMinDomain($d); } catch (Exception $e) { } return $d; }