YetiForceCompany/YetiForceCRM

View on GitHub
app/Extension/HTMLPurifier/Domain.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

false to array comparison
Open

        if (null !== $host && false !== strpos($host, '.') && false !== $this->allowedDomains && !\in_array($host, $this->allowedDomains)) {

Class extends undeclared class \HTMLPurifier_URIFilter
Open

class Domain extends \HTMLPurifier_URIFilter
Severity: Critical
Found in app/Extension/HTMLPurifier/Domain.php by phan

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedDomains = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function prepare($config)

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->allowedDomains = \Config\Security::$purifierAllowedDomains ?? [];

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $host = $uri->host;

Spaces must be used to indent lines; tabs are not allowed
Open

            $host = parse_url('xxx://' . $uri->path)['host'] ?? '';

Spaces must be used to indent lines; tabs are not allowed
Open

        } elseif ('data' === $uri->scheme || 'mailto' === $uri->scheme || 'tel' === $uri->scheme) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    public $name = 'Domain';

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed domains. */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function filter(&$uri, $config, $context)

Spaces must be used to indent lines; tabs are not allowed
Open

            return true;

Spaces must be used to indent lines; tabs are not allowed
Open

        if (null !== $host && false !== strpos($host, '.') && false !== $this->allowedDomains && !\in_array($host, $this->allowedDomains)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Line exceeds 120 characters; contains 140 characters
Open

        if (null !== $host && false !== strpos($host, '.') && false !== $this->allowedDomains && !\in_array($host, $this->allowedDomains)) {

Spaces must be used to indent lines; tabs are not allowed
Open

            return false;

Spaces must be used to indent lines; tabs are not allowed
Open

        return true;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if (null === $uri->scheme) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

There are no issues that match your filters.

Category
Status