• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xemlock / htmlpurifier-html5 / 16898969866

12 Aug 2025 04:28AM UTC coverage: 99.276%. Remained the same
16898969866

Pull #87

github

web-flow
Bump actions/checkout from 4 to 5

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #87: Bump actions/checkout from 4 to 5

1508 of 1519 relevant lines covered (99.28%)

3883.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/library/HTMLPurifier/URIFilter/HTML5/SafeLink.php
1
<?php
2

3
class HTMLPurifier_URIFilter_HTML5_SafeLink extends HTMLPurifier_URIFilter
4
{
5
    /**
6
     * @type string
7
     */
8
    public $name = 'HTML5_SafeLink';
9

10
    /**
11
     * @type bool
12
     */
13
    public $always_load = true;
14

15
    /**
16
     * @type string
17
     */
18
    protected $regexp = null;
19

20
    /**
21
     * @param HTMLPurifier_Config $config
22
     * @return bool
23
     */
24
    public function prepare($config)
25
    {
26
        $this->regexp = $config->get('URI.SafeLinkRegexp');
1,164✔
27
        return true;
1,164✔
28
    }
29

30
    /**
31
     * @param HTMLPurifier_URI $uri
32
     * @param HTMLPurifier_Config $config
33
     * @param HTMLPurifier_Context $context
34
     * @return bool
35
     */
36
    public function filter(&$uri, $config, $context)
37
    {
38
        // check if filter not applicable
39
        if (!$config->get('HTML.SafeLink')) {
1,152✔
40
            return true;
1,020✔
41
        }
42

43
        $token = $context->get('CurrentToken', true);
132✔
44
        if (!($token && $token->name == 'link')) {
132✔
45
            return true;
×
46
        }
47

48
        // check if we actually have some whitelists enabled
49
        if ($this->regexp === null) {
132✔
50
            return false;
12✔
51
        }
52

53
        // actually check the whitelists
54
        return preg_match($this->regexp, $uri->toString());
120✔
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc