Commons:
- Use same character-stripping logic as IA when looking for RDF file - Better handling of empty RDF files
This commit is contained in:
parent
2d0874dd66
commit
9dad2c6048
1 changed files with 9 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue