MobileFrontend
MobileoptimisedfrontendforMediaWiki
MobileFrontend\WMFBaseDomainExtractor Class Reference

Utility class to find base domain for given host. More...

+ Inheritance diagram for MobileFrontend\WMFBaseDomainExtractor:
+ Collaboration diagram for MobileFrontend\WMFBaseDomainExtractor:

Public Member Functions

 getCookieDomain ( $server)
 Try to extract the WMF base domain from $server Returns $server if no WMF base domain is found. More...
 

Detailed Description

Utility class to find base domain for given host.

This class contains a hardcoded list of all WMF hosts and WMF specific domain logic. As we never experienced any bug requests from users and we do not change domains too often there is no need to put that hosts list into settings.

See also
T148975

Member Function Documentation

◆ getCookieDomain()

MobileFrontend\WMFBaseDomainExtractor::getCookieDomain (   $server)

Try to extract the WMF base domain from $server Returns $server if no WMF base domain is found.

Although some browsers will accept cookies without the initial . in domain RFC 2109 requires it to be included.

$server must be a valid URL (i.e. with the scheme included, http or https or protocol-relative e.g. //en.m.wikipedia.org'). NULL and empty strings can also be taken but will return NULL or empty string respectively.

Parameters
string$serverURL
Returns
string|null Hostname

Implements MobileFrontend\BaseDomainExtractorInterface.


The documentation for this class was generated from the following file: