1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00
This commit is contained in:
DanieL 2022-11-29 17:35:03 -03:00
parent 641e1e48e6
commit ab2d4ab3ae

View file

@ -70,10 +70,14 @@ if (urlParams.has('debug')) {
isDebuging = false;
}
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
function replaceAll(str, match, replacement){
return str.replace(new RegExp(escapeRegExp(match), 'g'), ()=>replacement);
}
if(typeof String.prototype.replaceAll === "undefined") {
String.prototype.replaceAll = function(match, replace) {
return this.replace(new RegExp(match, 'g'), () => replace);
}
String.prototype.replaceAll = replaceAll
}
async function setBodyOnline() {