Skip to content

Commit 2834312

Browse files
committed
Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent f5740cf commit 2834312

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Resources/views/Profiler/base_js.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,13 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
331331
332332
/* prevent logging AJAX calls to static and inline files, like templates */
333333
var path = url;
334-
if (url.substr(0, 1) === '/') {
334+
if (url.slice(0, 1) === '/') {
335335
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
336-
path = url.substr({{ request.basePath|length }});
336+
path = url.slice({{ request.basePath|length }});
337337
}
338338
}
339339
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
340-
path = url.substr({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
340+
path = url.slice({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
341341
}
342342
343343
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {

0 commit comments

Comments
 (0)