@ 2018-07-03T19:24:57Z <?php
//$payload = file_get_contents('./csp-log.log');
$payload = "{\"csp-report\":{\"document-uri\":\"http://athleticssite.com/\",
\"referrer\":\"\",
\"violated-directive\":\"img-src\",
\"effective-directive\":\"img-src\",
\"original-policy\":\"default-src 'self' https://someurl.com; script-src 'self' 'unsafe-inline' https://use.typekit.com https://google-analytics.com https://ajax.googleapis.com https://js.hsforms.net https://ssl.google-analytics.com; img-src 'self' https://p.typekit.net https://ssl.google-analytics.com ; font-src https://use.typekit.com; report-uri /csp-violations-report-endpoint/;\",
\"disposition\":\"report\",
\"blocked-uri\":\"https://someurl.com/path/to/file/516.large.jpg?1530632190456\",
\"status-code\":200,
\"script-sample\":\"\"}}
{\"csp-report\":{\"document-uri\":\"http://athleticssite.com/\",
\"referrer\":\"\",
\"violated-directive\":\"img-src\",
\"effective-directive\":\"img-src\",
\"original-policy\":\"default-src 'self' https://someurl.com; script-src 'self' 'unsafe-inline' https://use.typekit.com https://google-analytics.com https://ajax.googleapis.com https://js.hsforms.net https://ssl.google-analytics.com; img-src 'self' https://p.typekit.net https://ssl.google-analytics.com ; font-src https://use.typekit.com; report-uri /csp-violations-report-endpoint/;\",
\"disposition\":\"report\",
\"blocked-uri\":\"https://someurl.com/path/to/file/516.large.jpg?1530632190456\",
\"status-code\":200,
\"script-sample\":\"\"}}";
$matches = [];
preg_match_all('/"blocked-uri":"(.*?)",/m', $payload, $matches);
/*
for($i = 0; $i < count($matches[1]); $i++) {
echo $matches[1][$i] . "\n";
}
*/
foreach($matches as $match => $uri) {
echo $uri[1] . "\n";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 "blocked-uri":"https://someurl.com/path/to/file/516.large.jpg?1530632190456",
https://someurl.com/path/to/file/516.large.jpg?1530632190456
Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
"blocked-uri":"https://someurl.com/path/to/file/516.large.jpg?1530632190456",
https://someurl.com/path/to/file/516.large.jpg?1530632190456
preferences:dark mode live preview
149.27 ms | 402 KiB | 163 Q