diff --git a/server/composer.json b/server/composer.json index bcf6f0d..3f7c2e1 100644 --- a/server/composer.json +++ b/server/composer.json @@ -6,6 +6,10 @@ { "type": "vcs", "url": "https://github.com/allerta-vvf/tiny-html-minifier" + }, + { + "type": "vcs", + "url": "https://github.com/allerta-vvf/php-debugbar" } ], "require": { @@ -17,7 +21,7 @@ "ezyang/htmlpurifier": "^4.13", "brick/phonenumber": "^0.2.2", "sentry/sdk": "^3.1", - "maximebf/debugbar": "^1.16", + "maximebf/debugbar": "dev-master", "azuyalabs/yasumi": "^2.4", "ministryofweb/php-osm-tiles": "^2.0", "jenstornell/tiny-html-minifier": "dev-master", diff --git a/server/composer.lock b/server/composer.lock index d222917..5053b1d 100644 --- a/server/composer.lock +++ b/server/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7c4057567b13ddf492603d706b796c68", + "content-hash": "4c5225e9eaf82f46758dd24bc5717c7d", "packages": [ { "name": "azuyalabs/yasumi", @@ -876,16 +876,16 @@ }, { "name": "maximebf/debugbar", - "version": "v1.16.5", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62" + "url": "https://github.com/allerta-vvf/php-debugbar.git", + "reference": "f9b3c4b7c1a79db817435d3817c3a997101fefa9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6d51ee9e94cff14412783785e79a4e7ef97b9d62", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62", + "url": "https://api.github.com/repos/allerta-vvf/php-debugbar/zipball/f9b3c4b7c1a79db817435d3817c3a997101fefa9", + "reference": "f9b3c4b7c1a79db817435d3817c3a997101fefa9", "shasum": "" }, "require": { @@ -901,6 +901,7 @@ "monolog/monolog": "Log using Monolog", "predis/predis": "Redis storage" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -912,7 +913,6 @@ "DebugBar\\": "src/DebugBar/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -934,10 +934,9 @@ "debugbar" ], "support": { - "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.5" + "source": "https://github.com/allerta-vvf/php-debugbar/tree/master" }, - "time": "2020-12-07T11:07:24+00:00" + "time": "2021-05-27T13:04:53+00:00" }, { "name": "ministryofweb/php-osm-tiles", @@ -998,12 +997,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "b5543adef5e16738471a52fdf55ff802edf1141d" + "reference": "dafa1911fd7c1560c64d19556cbd4c599fed15ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/b5543adef5e16738471a52fdf55ff802edf1141d", - "reference": "b5543adef5e16738471a52fdf55ff802edf1141d", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/dafa1911fd7c1560c64d19556cbd4c599fed15ea", + "reference": "dafa1911fd7c1560c64d19556cbd4c599fed15ea", "shasum": "" }, "require": { @@ -1011,7 +1010,7 @@ }, "require-dev": { "doctrine/coding-standard": "^9.0", - "phpbench/phpbench": "^1.0@beta", + "phpbench/phpbench": "^1.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12", "phpstan/phpstan-deprecation-rules": "^0.12", @@ -1053,7 +1052,7 @@ "issues": "https://github.com/nikic/FastRoute/issues", "source": "https://github.com/nikic/FastRoute/tree/master" }, - "time": "2021-04-27T09:57:16+00:00" + "time": "2021-05-24T09:28:21+00:00" }, { "name": "php-http/client-common", @@ -2274,16 +2273,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2295,7 +2294,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2333,7 +2332,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -2349,20 +2348,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", "shasum": "" }, "require": { @@ -2374,7 +2373,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2413,7 +2412,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" }, "funding": [ { @@ -2429,20 +2428,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { @@ -2451,7 +2450,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2492,7 +2491,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, "funding": [ { @@ -2508,20 +2507,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { @@ -2530,7 +2529,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2575,7 +2574,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -2591,20 +2590,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "9773608c15d3fe6ba2b6456a124777a7b8ffee2a" + "reference": "9165effa2eb8a31bb3fa608df9d529920d21ddd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9773608c15d3fe6ba2b6456a124777a7b8ffee2a", - "reference": "9773608c15d3fe6ba2b6456a124777a7b8ffee2a", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9165effa2eb8a31bb3fa608df9d529920d21ddd9", + "reference": "9165effa2eb8a31bb3fa608df9d529920d21ddd9", "shasum": "" }, "require": { @@ -2616,7 +2615,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2654,7 +2653,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.23.0" }, "funding": [ { @@ -2670,7 +2669,7 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/service-contracts", @@ -3069,6 +3068,7 @@ "minimum-stability": "stable", "stability-flags": { "nikic/fast-route": 20, + "maximebf/debugbar": 20, "jenstornell/tiny-html-minifier": 20 }, "prefer-stable": false, diff --git a/server/core.php b/server/core.php index 03221e2..3381fea 100644 --- a/server/core.php +++ b/server/core.php @@ -912,9 +912,9 @@ function init_class($enableDebugger=true, $headers=true) $csp_rules = [ "default-src 'self' data: *.tile.openstreetmap.org nominatim.openstreetmap.org", "connect-src 'self' *.sentry.io nominatim.openstreetmap.org", - "script-src 'nonce-{$tools->script_nonce}' 'self'", + "script-src 'nonce-{$tools->script_nonce}' 'self' 'unsafe-eval'", "img-src 'self' data: *.tile.openstreetmap.org", - "object-src", + "object-src 'self'", "style-src 'self' 'unsafe-inline'", "base-uri 'self'" ]; diff --git a/server/error_page.php b/server/error_page.php index e01df0b..17ee5cf 100644 --- a/server/error_page.php +++ b/server/error_page.php @@ -1,6 +1,6 @@ script_nonce; + } catch (\Exception $e) { + } ?>

Error page based on work by . - - + + auth->getUserId(); $result = $db->select("SELECT * FROM `".DB_PREFIX."_schedules` WHERE `user`={$user_id}"); if(!empty($result)){ @@ -140,7 +142,11 @@ $holidays_select_none = t("Remove selections", false); echo(<< - {$holidays_select_all} / {$holidays_select_none} + {$holidays_select_all} / {$holidays_select_none} + {# /Menu #} {% endblock %} {% endif %} diff --git a/server/templates/edit_service.html b/server/templates/edit_service.html index 94d8bfa..2e71a88 100644 --- a/server/templates/edit_service.html +++ b/server/templates/edit_service.html @@ -86,14 +86,20 @@
- + +
- - {{ script('maps.js', 'allertaJS.maps.loadMap();') }} + + {{ script('maps.js') }} {% else %}
diff --git a/server/templates/edit_training.html b/server/templates/edit_training.html index da121aa..4c921c7 100644 --- a/server/templates/edit_training.html +++ b/server/templates/edit_training.html @@ -70,14 +70,21 @@
- + +
- {{ script('maps.js', 'allertaJS.maps.loadMap();') }} + + {{ script('maps.js') }} {% else %}
diff --git a/server/templates/list.html b/server/templates/list.html index 544f0d7..d4df15a 100644 --- a/server/templates/list.html +++ b/server/templates/list.html @@ -36,9 +36,8 @@

{{ 'Are you available in case of alert?'|t }}

- - + +
diff --git a/server/ui.php b/server/ui.php index 99c1717..058383e 100644 --- a/server/ui.php +++ b/server/ui.php @@ -10,6 +10,7 @@ if(!is_null($debugbar)){ $debugbarRenderer->disableVendor("jquery"); $debugbarRenderer->setEnableJqueryNoConflict(false); $debugbarRenderer->setOpenHandlerUrl('debug_open.php'); + $debugbarRenderer->setJSNonce($nonce); } else { $enable_debugbar = false; } @@ -95,15 +96,12 @@ $function_resource = new \Twig\TwigFunction( $twig->addFunction($function_resource); $function_script = new \Twig\TwigFunction( - 'script', function ($file, $onLoad=false) { + 'script', function ($file) { global $nonce, $url_software, $webpack_manifest; $script_url = $url_software . "/resources/dist/" . $webpack_manifest[$file]["src"]; $script_integrity = $webpack_manifest[$file]["integrity"]; $script_tag = "