1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Replace deprecated String.prototype.substr() (#2948)

String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() or substring() which work similarily but aren't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot 2022-03-07 01:02:27 +01:00 committed by GitHub
parent 84951cbc74
commit 8a75e8a165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 72 additions and 72 deletions

View file

@ -558,7 +558,7 @@ scApp.filter("sc_filter_number", function(){
scApp.filter("sc_filter_less", function(){
return function(v) {
return v? (v.length > 15? v.substr(0, 15) + "...":v):v;
return v? (v.length > 15? v.slice(0, 15) + "...":v):v;
};
});
@ -636,7 +636,7 @@ scApp.provider("$sc_server", [function(){
var $location = self.$location;
var url = $location.absUrl();
if (url.indexOf('?') > 0) {
url = url.substr(0, url.indexOf('?'));
url = url.slice(0, url.indexOf('?'));
}
url += '?';