www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b2d561252641aad1b7aa45c13104678dc73d460f
parent 2afebc79d0da8ba655c36d37856c2f3c28506d1e
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  7 Apr 2015 16:59:33 -0400

Fix sync and debug output submission in Nightly

(sendAsBinary() removal)

Diffstat:
Mchrome/content/zotero/preferences/preferences_advanced.js | 9++++++++-
Mchrome/content/zotero/xpcom/sync.js | 7++++++-
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/preferences/preferences_advanced.js b/chrome/content/zotero/preferences/preferences_advanced.js @@ -730,9 +730,16 @@ Zotero_Preferences.Debug_Output = { } }; try { - req.sendAsBinary(data); + // Send binary data + let numBytes = data.length, ui8Data = new Uint8Array(numBytes); + for (let i = 0; i < numBytes; i++) { + ui8Data[i] = data.charCodeAt(i) & 0xff; + } + req.send(ui8Data); } catch (e) { + Zotero.debug(e, 1); + Components.utils.reportError(e); ps.alert( null, Zotero.getString('general.error'), diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -1804,7 +1804,12 @@ Zotero.Sync.Server = new function () { } }; try { - req.sendAsBinary(data); + // Send binary data + let numBytes = data.length, ui8Data = new Uint8Array(numBytes); + for (let i = 0; i < numBytes; i++) { + ui8Data[i] = data.charCodeAt(i) & 0xff; + } + req.send(ui8Data); } catch (e) { _error(e);