Skip to content
Snippets Groups Projects
Commit 2fff4d55 authored by deuce's avatar deuce
Browse files

Fix length parsing and encode_xml() with non-string types.

parent 7fe1878b
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ function podcast_get_enclosure_info(enc)
log("HEAD request of "+enc.url+" did not return either Content-Type or Content-Length");
return false;
}
enc.length = hdrs['Content-Length'][0] + 0;
enc.length = parseInt(hdrs['Content-Length'][0], 10);
enc.type = hdrs['Content-Type'][0].replace(/^\s*(.*?)\s*/, "$1");
return true;
}
......@@ -14,6 +14,7 @@ var item_info;
function encode_xml(str)
{
str = str.toString();
str=str.replace(/&/g, '&');
str=str.replace(/</g, '&lt;');
str=str.replace(/>/g, '&gt;');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment