1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
This commit is contained in:
DanieL 2022-11-29 18:13:31 -03:00
parent d3b5432fb7
commit 7fc281ca0a

View file

@ -74,7 +74,7 @@ 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);
return str.replace(new RegExp(escapeRegExp(match), 'g'), replacement);
}
if(typeof String.prototype.replaceAll === "undefined") {
String.prototype.replaceAll = replaceAll