*/
private function getFlags( $report ) {
$reportOnly = $this->getParameter( 'reportonly' );
- $userAgent = $this->getRequest()->getHeader( 'user-agent' );
$source = $this->getParameter( 'source' );
+ $falsePositives = $this->getConfig()->get( 'CSPFalsePositiveUrls' );
$flags = [];
if ( $source !== 'internal' ) {
if ( $reportOnly ) {
$flags[] = 'report-only';
}
+
+ if (
+ ( isset( $report['blocked-uri'] ) &&
+ isset( $falsePositives[$report['blocked-uri']] ) )
+ || ( isset( $report['source-file'] ) &&
+ isset( $falsePositives[$report['source-file']] ) )
+ ) {
+ // Report caused by Ad-Ware
+ $flags[] = 'false-positive';
+ }
return $flags;
}