diff options
author | CommanderRoot <CommanderRoot@users.noreply.github.com> | 2022-05-03 15:52:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 15:52:45 +0300 |
commit | 56640ae815fbace78c62482711cb1733d26cee5e (patch) | |
tree | 18078e6b9ec3e8ffe7cc6ac28e4c8f0a309bce94 /plugins/CoreHome/javascripts/broadcast.js | |
parent | 34ea7bbfcbc5a79a5c7b675b8cd2134cdda74cbe (diff) |
Replace deprecated String.prototype.substr() (#19111)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Diffstat (limited to 'plugins/CoreHome/javascripts/broadcast.js')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 44ace8fe19..22b7c96e73 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -100,7 +100,7 @@ var broadcast = { // hash doesn't contain the first # character. if (hash && 0 === (''+hash).indexOf('/')) { - hash = (''+hash).substr(1); + hash = (''+hash).slice(1); } @@ -773,8 +773,8 @@ var broadcast = { */ getValueFromHash: function (param, url) { var hashStr = broadcast.getHashFromUrl(url); - if (hashStr.substr(0, 1) == '#') { - hashStr = hashStr.substr(1); + if (hashStr.slice(0, 1) == '#') { + hashStr = hashStr.slice(1); } hashStr = hashStr.split('#')[0]; @@ -795,7 +795,7 @@ var broadcast = { var lookFor = param + '='; if (url.indexOf('?') >= 0) { - url = url.substr(url.indexOf('?')+1); + url = url.slice(url.indexOf('?')+1); } var urlPieces = url.split('&'); |