From 7be8570eff4a1b0335c3592ee0d85a2dad7b7615 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Mon, 13 Dec 2021 14:25:45 +0100 Subject: [PATCH] JS: use startsWith() --- .../Resources/views/Profiler/base_js.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index fbe3c0794314b..3764d9782acfb 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -351,7 +351,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { /* prevent logging AJAX calls to static and inline files, like templates */ var path = url; - if (url.substr(0, 1) === '/') { + if (url.startsWith('/')) { if (0 === url.indexOf('{{ request.basePath|e('js') }}')) { path = url.substr({{ request.basePath|length }}); }