+ * @copyright Catalyst IT
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+function xmldb_local_csp_upgrade($oldversion) {
+ global $DB;
+ $dbman = $DB->get_manager();
+
+ if ($oldversion < 2019100100) {
+
+ // Changing precision of field documenturi on table local_csp to (1333).
+ $table = new xmldb_table('local_csp');
+ $field = new xmldb_field('documenturi', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'id');
+
+ // Launch change of precision for field documenturi.
+ $dbman->change_field_precision($table, $field);
+
+ // Changing precision of field blockeduri on table local_csp to (1333).
+ $table = new xmldb_table('local_csp');
+ $field = new xmldb_field('blockeduri', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'documenturi');
+
+ // Launch change of precision for field blockeduri.
+ $dbman->change_field_precision($table, $field);
+
+ // Csp savepoint reached.
+ upgrade_plugin_savepoint(true, 2019100100, 'local', 'csp');
+ }
+
+ return true;
+}
+
diff --git a/lang/en/local_csp.php b/lang/en/local_csp.php
index b8f489a..fb9bd97 100644
--- a/lang/en/local_csp.php
+++ b/lang/en/local_csp.php
@@ -45,7 +45,9 @@
$string['cspsettings'] = 'Content security policy settings';
$string['cspsettingsinfo'] = 'CSP works through adding a special HTTP response header to every Moodle page. Modern browsers, when they see this header, are able to perform certain actions e.g. block insecure content on such pages. Please read more about CSP here.
If you leave any of these settings blank CSP headers will not be used.
';
$string['documenturi'] = 'Violation at';
-$string['failcounter'] = 'Count';
+$string['failcounter'] = '#';
+$string['highestviolaters'] = 'Top Violation Sources';
+$string['highestviolaterscount'] = 'Count: {$a}';
$string['loadingmixedcontentdescription'] = 'When accessing moodle website via HTTPS browser prohibits displaying of the below resources because they origin from HTTP.
You should be able to see it in your browser\'s Javascript console.';
$string['loadinsecurecss'] = 'Load insecure css from {$a}';
$string['loadinsecureiframe'] = 'Load insecure iframe from {$a}';
@@ -58,7 +60,6 @@
$string['reset'] = 'Reset';
$string['resetallcspstatistics'] = 'Reset all statistics';
$string['scspheadernone'] = 'Not used';
-$string['timecreated'] = 'Recorded';
$string['timeupdated'] = 'Last';
$string['violateddirective'] = 'Policy';
$string['privacy:metadata'] = 'The CSP plugin contains no user specific data.';
diff --git a/samples/sample.html b/samples/sample.html
index efc9aa1..e0656fc 100644
--- a/samples/sample.html
+++ b/samples/sample.html
@@ -7,4 +7,4 @@
Successfully loaded sample.html!
-