throw new UserInputException('cookieDomain', 'containsPath');
}
+ // strip port from cookie domain
+ $regex = new Regex(':[0-9]+$');
+ $this->cookieDomain = $regex->replace($this->cookieDomain, '');
+
// check if cookie domain shares the same domain (may exclude subdomains)
- if (!StringUtil::endsWith($this->domainName, $this->cookieDomain)) {
+ if (!StringUtil::endsWith($regex->replace($this->domainName, ''), $this->cookieDomain)) {
throw new UserInputException('cookieDomain', 'notValid');
}
}
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
use wcf\system\language\LanguageFactory;
+use wcf\system\Regex;
use wcf\system\WCF;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
// calculate cookie path
$domains = array();
+ $regex = new Regex(':[0-9]+');
foreach ($this->objects as $application) {
$domainName = $application->domainName;
- if (StringUtil::endsWith($domainName, $application->cookieDomain)) {
+ if (StringUtil::endsWith($regex->replace($domainName, ''), $application->cookieDomain)) {
$domainName = $application->cookieDomain;
}