Fix possible str.replace freeze when unpacking packer

This commit is contained in:
Einar Lielmanis 2013-02-25 15:29:09 +02:00
parent a3a091c8c1
commit 4dfe268087

View File

@ -25,7 +25,7 @@ var P_A_C_K_E_R = {
unpack: function (str) {
var chunks = P_A_C_K_E_R.get_chunks(str);
for(var i = 0; i < chunks.length; i++) {
str = str.replace(chunks[i], P_A_C_K_E_R.unpack_chunk(chunks[i]))
str = str.split(chunks[i]).join( P_A_C_K_E_R.unpack_chunk(chunks[i]) );
}
return str;
},