ScanEntry
in package
A scan result which can be persisted to the database.
Table of Contents
Properties
- $attribute : string
- The blockable HTML attribute.
- $blockable : ScannableBlockable
- The template blockable which caused this scan entry to be found.
- $blocked_url : string
- The found blocked URL.
- $blocked_url_hash : string
- The found blocked URL as hash to be used as `UNIQUE KEY`.
- $blocked_url_host : string
- The found blocked URL (only the host) for grouping purposes.
- $expressions : array<string|int, string>
- The expression of the `host` which is used while found this scan entry. This property is only filled for the scan process itself!
- $lock : mixed
- If `true` no other false-positive mechanisms can modify this scan entry.
- $markup : Markup|null
- Markup of the blocked element. This is only set for inline scripts, inline styles and templates with `SelectorSyntaxBlocker`.
- $source_url : string
- The source URL this entry was found.
- $source_url_hash : string
- The source URL this entry was found as hash to be used as `UNIQUE KEY`.
- $tag : string
- The blockable HTML tag.
- $template : string
- Template identifier for the content blocker.
Methods
- calculateFields() : mixed
- Calculate some fields. This is necessary, so we do not need to always calculate hashes and hosts. Do this before persisting to your database!
- deduplicate() : array<string|int, ScanEntry>
- Dedupe scan entries by their ID.
- getId() : string
- Get the ID of this scan entry. In the scanner mechanism multiple scan entries can be found for the same markup. This ID is unique for this scan entry so it can be used together with the static method `deduplicate`.
Properties
$attribute
The blockable HTML attribute.
public
string
$attribute
Can be null
, e.g. inline scripts.
$blockable
The template blockable which caused this scan entry to be found.
public
ScannableBlockable
$blockable
$blocked_url
The found blocked URL.
public
string
$blocked_url
$blocked_url_hash
The found blocked URL as hash to be used as `UNIQUE KEY`.
public
string
$blocked_url_hash
= ''
$blocked_url_host
The found blocked URL (only the host) for grouping purposes.
public
string
$blocked_url_host
$expressions
The expression of the `host` which is used while found this scan entry. This property is only filled for the scan process itself!
public
array<string|int, string>
$expressions
= []
$lock
If `true` no other false-positive mechanisms can modify this scan entry.
public
mixed
$lock
= false
$markup
Markup of the blocked element. This is only set for inline scripts, inline styles and templates with `SelectorSyntaxBlocker`.
public
Markup|null
$markup
$source_url
The source URL this entry was found.
public
string
$source_url
$source_url_hash
The source URL this entry was found as hash to be used as `UNIQUE KEY`.
public
string
$source_url_hash
$tag
The blockable HTML tag.
public
string
$tag
$template
Template identifier for the content blocker.
public
string
$template
= ''
Methods
calculateFields()
Calculate some fields. This is necessary, so we do not need to always calculate hashes and hosts. Do this before persisting to your database!
public
calculateFields() : mixed
deduplicate()
Dedupe scan entries by their ID.
public
static deduplicate(array<string|int, ScanEntry> $scanEntries) : array<string|int, ScanEntry>
Parameters
- $scanEntries : array<string|int, ScanEntry>
Return values
array<string|int, ScanEntry>getId()
Get the ID of this scan entry. In the scanner mechanism multiple scan entries can be found for the same markup. This ID is unique for this scan entry so it can be used together with the static method `deduplicate`.
public
getId() : string