use wcf\system\email\Email;
use wcf\system\email\transport\exception\TransientFailure;
use wcf\system\io\RemoteFile;
-use wcf\util\StringUtil;
if (MAIL_SMTP_STARTTLS != 'may') {
return;
}
$value = 'encrypt';
-if (StringUtil::startsWith(MAIL_SMTP_HOST, 'ssl://')) {
+if (\str_starts_with(MAIL_SMTP_HOST, 'ssl://')) {
// Anything using proper SSL can't use STARTTLS.
$value = 'none';
} elseif (MAIL_SMTP_PORT == 465) {
// rewrite schemaless URLs to https
$scheme = Url::parse($url)['scheme'];
if (!$scheme) {
- if (StringUtil::startsWith($url, '//')) {
+ if (\str_starts_with($url, '//')) {
$url = 'https:' . $url;
} else {
throw new \DomainException("Refusing to proxy a schemaless URL that does not start with //");
*/
public function isConnectedWithFacebook()
{
- return StringUtil::startsWith($this->authData, 'facebook:');
+ return \str_starts_with($this->authData, 'facebook:');
}
/**
*/
public function isConnectedWithGithub()
{
- return StringUtil::startsWith($this->authData, 'github:');
+ return \str_starts_with($this->authData, 'github:');
}
/**
*/
public function isConnectedWithGoogle()
{
- return StringUtil::startsWith($this->authData, 'google:');
+ return \str_starts_with($this->authData, 'google:');
}
/**
*/
public function isConnectedWithTwitter()
{
- return StringUtil::startsWith($this->authData, 'twitter:');
+ return \str_starts_with($this->authData, 'twitter:');
}
/**
WCF::getSession()->unregister('__oauthUser');
}
}
- if ($this->githubDisconnect && StringUtil::startsWith(WCF::getUser()->authData, 'github:')) {
+ if ($this->githubDisconnect && \str_starts_with(WCF::getUser()->authData, 'github:')) {
$updateParameters['authData'] = '';
$success[] = 'wcf.user.3rdparty.github.disconnect.success';
}
WCF::getSession()->unregister('__oauthUser');
}
}
- if ($this->twitterDisconnect && StringUtil::startsWith(WCF::getUser()->authData, 'twitter:')) {
+ if ($this->twitterDisconnect && \str_starts_with(WCF::getUser()->authData, 'twitter:')) {
$updateParameters['authData'] = '';
$success[] = 'wcf.user.3rdparty.twitter.disconnect.success';
}
WCF::getSession()->unregister('__oauthUser');
}
}
- if ($this->facebookDisconnect && StringUtil::startsWith(WCF::getUser()->authData, 'facebook:')) {
+ if ($this->facebookDisconnect && \str_starts_with(WCF::getUser()->authData, 'facebook:')) {
$updateParameters['authData'] = '';
$success[] = 'wcf.user.3rdparty.facebook.disconnect.success';
}
WCF::getSession()->unregister('__oauthUser');
}
}
- if ($this->googleDisconnect && StringUtil::startsWith(WCF::getUser()->authData, 'google:')) {
+ if ($this->googleDisconnect && \str_starts_with(WCF::getUser()->authData, 'google:')) {
$updateParameters['authData'] = '';
$success[] = 'wcf.user.3rdparty.google.disconnect.success';
}
public function addHeader($header, $value)
{
$header = \mb_strtolower($header);
- if (!StringUtil::startsWith($header, 'x-')) {
+ if (!\str_starts_with($header, 'x-')) {
throw new \DomainException(
"The header '{$header}' may not be set. You may only set user defined headers (starting with 'X-')."
);
);
}
- if (!StringUtil::startsWith($header[0], 'x-') && !StringUtil::startsWith($header[0], 'content-')) {
+ if (
+ !\str_starts_with($header[0], 'x-')
+ && !\str_starts_with($header[0], 'content-')
+ ) {
throw new \DomainException("The header '" . $header[0] . "' may not be set. You may only set headers starting with 'X-' or 'Content-'.");
}
}
// o Before sending a line of mail text, the SMTP client checks the
// first character of the line. If it is a period, one additional
// period is inserted at the beginning of the line.
- if (StringUtil::startsWith($item, '.')) {
+ if (\str_starts_with($item, '.')) {
return '.' . $item;
}
protected function compileStylesheet(string $scss, array $variables): string
{
foreach ($variables as &$value) {
- if (StringUtil::startsWith($value, '../')) {
+ if (\str_starts_with($value, '../')) {
$value = '"' . $value . '"';
}
}