use wcf\data\user\UserProfileAction;
use wcf\system\image\adapter\ImagickImageAdapter;
use wcf\system\WCF;
-use wcf\util\StringUtil;
// set default landing page
$sql = "UPDATE wcf1_application
})),
TemplateFormNode::create('pathPasteHelper')
->application('wcf')
- ->templateName('__devtoolsProjectPathPasteHelper')
+ ->templateName('__devtoolsProjectPathPasteHelper'),
]);
$dataTab->appendChild($dataContainer);
);
$response = HttpFactory::makeClientWithTimeout(5)->send($request);
+
return (new MapperBuilder())
->allowSuperfluousKeys()
->mapper()
));
$this->form->getDataHandler()->addProcessor(new CustomFormDataProcessor(
'sourceLanguage',
- function (IFormDocument $document, array $parameters) {
+ static function (IFormDocument $document, array $parameters) {
if ($document->getFormMode() !== IFormDocument::FORM_MODE_CREATE) {
return $parameters;
}
$this->variables['wcfPageThemeColor'] = $this->variables['wcfHeaderBackground'];
}
if ($this->hasDarkMode && empty($this->variables[self::DARK_MODE_PREFIX . 'wcfPageThemeColor'])) {
-
$this->variables[self::DARK_MODE_PREFIX . 'wcfPageThemeColor'] = $this->variables[self::DARK_MODE_PREFIX . 'wcfHeaderBackground'];
}
namespace wcf\data\user\rank;
use wcf\data\I18nDatabaseObjectList;
-use wcf\data\user\rank\UserRank;
/**
* I18n implementation of user rank list.
// TODO: Remove this.
$width = 'auto';
-
if ($thumbnail) {
return $this->showImageAsThumbnail(
$attachment,
namespace wcf\system\category;
use wcf\data\article\ArticleAction;
-use wcf\data\article\ArticleList;
use wcf\data\category\CategoryEditor;
use wcf\system\WCF;
use wcf\system\html\node\AbstractHtmlNodeProcessor;
use wcf\util\DOMUtil;
use wcf\util\JSON;
-use wcf\util\StringUtil;
/**
* Processes `<img>` to handle embedded attachments.
// of the resize operation.
if ($element->parentNode->nodeName === 'figure') {
$this->mirrorWidthAttribute($element->parentNode);
+
return;
}
-
$width = $element->getAttribute("data-width");
if ($width && $width !== "100%") {
$style = $element->getAttribute("style");
protected function parseURL(\DOMText $text, $value, $allowURL, $allowMedia)
{
return \preg_replace_callback(
- "#(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))#iS",
+ "#(?i)\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))#iS",
function ($matches) use ($text, $allowURL, $allowMedia) {
$link = $matches[0];
foreach ($elementsWithStyles as $element) {
$style = $element->getAttribute("style");
$values = \array_map(
- fn (string $value) => StringUtil::trim($value),
+ static fn (string $value) => StringUtil::trim($value),
\explode(";", $style)
);
$values = \array_filter($values, static function (string $value) {
- list($keyword,) = \explode(":", $value, 2);
+ [$keyword] = \explode(":", $value, 2);
switch (StringUtil::trim($keyword)) {
case "color":
}
return new CronExpression(match ($expression) {
- '@hourly' => \sprintf('%d * * * *', $engine(0, 59)),
+ '@hourly' => \sprintf('%d * * * *', $engine(0, 59)),
'@daily' => \sprintf('%d %d * * *', $engine(0, 59), $engine(0, 23)),
'@weekly' => \sprintf('%d %d * * %d', $engine(0, 59), $engine(0, 23), $engine(0, 6)),
'@monthly' => \sprintf('%d %d %d * *', $engine(0, 59), $engine(0, 23), $engine(1, 28)),
use wcf\system\exception\SystemException;
use wcf\system\search\mysql\MysqlSearchIndexManager;
use wcf\system\SingletonFactory;
-use wcf\util\StringUtil;
/**
* Manages the search index.
if ($time instanceof \DateTimeImmutable) {
$dateTime = $time;
- } else if ($time instanceof \DateTime) {
+ } elseif ($time instanceof \DateTime) {
// Ensure we do not modify the original object.
$dateTime = \DateTimeImmutable::createFromMutable($time);
- } else if (\is_string($time) || \is_int($time)) {
+ } elseif (\is_string($time) || \is_int($time)) {
$timestamp = \intval($time);
$dateTime = (new \DateTimeImmutable('@' . $timestamp));
} else {
/**
* Indicates that a username is currently validated. If this event
* is interrupted, the username is considered to be invalid.
- *
+ *
* This event will not be fired for usernames changed by an administrator.
*
* @author Tim Duesterhus
/**
* Returns the name of the type to which the comment belong.
*/
- protected abstract function getTypeName(): string;
+ abstract protected function getTypeName(): string;
/**
* Returns the title of the object to which the comment belong.
*/
- protected abstract function getObjectTitle(): string;
+ abstract protected function getObjectTitle(): string;
}
/**
* Returns the name of the type to which the comment belong.
*/
- protected abstract function getTypeName(): string;
+ abstract protected function getTypeName(): string;
/**
* Returns the title of the object to which the comment belong.
*/
- protected abstract function getObjectTitle(): string;
+ abstract protected function getObjectTitle(): string;
}
namespace wcf\util;
-use wcf\system\exception\SystemException;
-
/**
* Provides helper methods to work with PHP's DOM implementation.
*
namespace wcf\util;
-use Spoofchecker;
use wcf\system\event\EventHandler;
use wcf\system\user\event\UsernameValidating;