mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 10:19:24 +02:00
Updates
This commit is contained in:
parent
641e1e48e6
commit
ab2d4ab3ae
1 changed files with 7 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue