$this->cookieDomain = $regex->replace($this->cookieDomain, '');
// check if cookie domain shares the same domain (may exclude subdomains)
- if (!StringUtil::endsWith($regex->replace($this->domainName, ''), $this->cookieDomain)) {
+ if (!\str_ends_with($regex->replace($this->domainName, ''), $this->cookieDomain)) {
throw new UserInputException('cookieDomain', 'invalid');
}
}
$this->cookieDomain = $regex->replace($this->cookieDomain, '');
// check if cookie domain shares the same domain (may exclude subdomains)
- if (!StringUtil::endsWith($regex->replace($this->domainName, ''), $this->cookieDomain)) {
+ if (!\str_ends_with($regex->replace($this->domainName, ''), $this->cookieDomain)) {
throw new UserInputException('cookieDomain', 'invalid');
}
}
throw new UserInputException('serverURL', 'invalid');
}
- if (StringUtil::endsWith(Url::parse($this->serverURL)['host'], '.woltlab.com', true)) {
+ if (\str_ends_with(Url::parse($this->serverURL)['host'], '.woltlab.com', true)) {
throw new UserInputException('serverURL', 'woltlab');
}
use wcf\system\language\LanguageFactory;
use wcf\system\Regex;
use wcf\system\WCF;
-use wcf\util\StringUtil;
/**
* Executes application-related actions.
WCF::getDB()->beginTransaction();
foreach ($this->getObjects() as $application) {
$domainName = $application->domainName;
- if (StringUtil::endsWith($regex->replace($domainName, ''), $application->cookieDomain)) {
+ if (\str_ends_with($regex->replace($domainName, ''), $application->cookieDomain)) {
$domainName = $application->cookieDomain;
}
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;
-use wcf\util\StringUtil;
/**
* Represents an attachment.
$this->getThumbnailLocation('tiny'),
] as $location
) {
- if (!StringUtil::endsWith($location, '.bin')) {
+ if (!\str_ends_with($location, '.bin')) {
\rename($location, $location . '.bin');
}
}
// copy templates
foreach ($templates as $template) {
- if (!StringUtil::endsWith($template['filename'], '.tpl')) {
+ if (!\str_ends_with($template['filename'], '.tpl')) {
continue;
}
use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
-use wcf\util\StringUtil;
/**
* Handles ACL permissions.
{
$optionList = new ACLOptionList();
if (!empty($categoryName)) {
- if (StringUtil::endsWith($categoryName, '.*')) {
+ if (\str_ends_with($categoryName, '.*')) {
$categoryName = \mb_substr($categoryName, 0, -1) . '%';
$optionList->getConditionBuilder()->add("acl_option.categoryName LIKE ?", [$categoryName]);
} else {
$addDomain = (\mb_strpos(
$application->cookieDomain,
'.'
- ) === false || StringUtil::endsWith(
+ ) === false || \str_ends_with(
$application->cookieDomain,
'.lan'
- ) || StringUtil::endsWith($application->cookieDomain, '.local')) ? false : true;
+ ) || \str_ends_with($application->cookieDomain, '.local')) ? false : true;
if (!$addDomain) {
return null;
if ($isWildcard && \mb_strpos($hostname, $host) !== false) {
// the prepended dot will ensure that `example.com` matches only
// on domains like `foo.example.com` but not on `bar-example.com`
- if (StringUtil::endsWith($hostname, '.' . $host)) {
+ if (\str_ends_with($hostname, '.' . $host)) {
$validHosts[$hostname] = $hostname;
return true;