Changeset 3451:bd71f12d4e47
- Timestamp:
- 12/12/16 15:47:44 (9 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
admin/csp_report.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin/csp_report.php
r3324 r3451 11 11 12 12 // Specify log file 13 define('LOGFILE',path::real(DC_ TPL_CACHE).'/csp_report.txt');13 define('LOGFILE',path::real(DC_VAR).'/csp/csp_report.json'); 14 14 15 15 // Get the raw POST data … … 32 32 // avoid false positives notifications coming from Safari extensions (diigo, evernote, etc.) 33 33 && strpos($source_file, 'safari-extension://') === false 34 && strpos($blocked_uri, 'safari-extension://') === false 34 35 35 36 // search engine extensions ? … … 39 40 && strpos($blocked_uri, 'webviewprogressproxy://') === false 40 41 41 ) { 42 // Google Search App see for details https://github.com/nico3333fr/CSP-useful/commit/ecc8f9b0b379ae643bc754d2db33c8b47e185fd1 43 && strpos($blocked_uri, 'gsa://onpageload') === false 44 45 ) { 42 46 // Prettify the JSON-formatted data 43 47 $data = json_encode( … … 46 50 ); 47 51 48 if (!($fp = @fopen(LOGFILE,'a'))) { 52 try { 53 // Check report dir (create it if necessary) 54 files::makeDir(dirname(LOGFILE),true); 55 56 if (!($fp = @fopen(LOGFILE,'a'))) { 57 return; 58 } 59 fprintf($fp,'%s',$data); 60 } catch (Exception $e) { 49 61 return; 50 62 } 51 fprintf($fp,'%s',$data);52 63 } 53 64 }
Note: See TracChangeset
for help on using the changeset viewer.
