- Use same character-stripping logic as IA when looking for RDF file
- Better handling of empty RDF files
This commit is contained in:
Dan Stillman 2010-07-13 17:47:01 +00:00
parent 2d0874dd66
commit 9dad2c6048

View file

@ -589,7 +589,9 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
return;
}
var rdfURI = self.downloadURI + '/' + zip.key;
var rdfURI = self.downloadURI + '/'
// Strip characters IA strips
+ zip.key.replace(/[^-A-Za-z0-9_.]/g, '-').replace(/-+/g, '-');
rdfURI = rdfURI.replace(/\.zip$/, "_zotero.rdf");
Zotero.Utilities.HTTP.doGet(rdfURI, function (xmlhttp) {
@ -600,6 +602,12 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
return;
}
if (!xmlhttp.responseText) {
Zotero.debug("RDF file is empty at " + xmlhttp.channel.originalURI.spec);
process(zips);
return;
}
Zotero.debug(xmlhttp.responseText);
var translate = new Zotero.Translate("import");