View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002125 | SOGo Connector | with SOGo | public | 2012-11-26 13:49 | 2013-01-18 14:32 |
| Reporter | Stefan | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | Monotone / nightly | ||||
| Summary | 0002125: Wrong filepath parsing in sync.addressbook.groupdav.js on Windows OS | ||||
| Description | Path is split with "/" separator. Should be "\" for Windows OS | ||||
| Additional Information | Patch uploaded | ||||
| Tags | No tags attached. | ||||
|
2012-11-26 13:49
|
sync.addressbook.groupdav.js.diff (927 bytes)
--- sync.addressbook.groupdav.js.old Do Nov 15 13:03:54 2012
+++ sync.addressbook.groupdav.js Mo Nov 26 14:34:16 2012
@@ -508,7 +508,13 @@
if (photoURL != "") {
/* warning: this might not work on windows, due to the accessing of files via uris */
if (urlIsInSOGoImageCache(photoURL)) {
- let parts = photoURL.split("/");
+ var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime);
+ let parts;
+ if (appInfo.OS == "WINNT"){
+ parts = photoURL.split("\\");
+ } else {
+ parts = photoURL.split("/");
+ }
let lastPart = parts[parts.length-1];
if (lastPart != "") {
deletePhotoFile(lastPart, true);
|
|
Can you please review your patch for the current tb17 sogo connector extension? In the meantime, I've added it for tb10. |
|
|
2013-01-18 09:36
|
bug-2125.diff (1,572 bytes)
--- sync.addressbook.groupdav.js Do Dez 6 15:12:42 2012
+++ sync.addressbook.groupdav.js_new Fr Jan 18 10:21:36 2013
@@ -523,18 +523,18 @@
}
let photoURL = oldCard.getProperty("PhotoURI", "");
if (photoURL != "") {
- /* warning: this might not work on windows, due to the accessing of files via uris */
if (urlIsInSOGoImageCache(photoURL)) {
- //for Windows: photoURL == file://absolute/path/to/some.jpg
- let parts = photoURL.split("/");
+ //for Windows: photoURL == file://C:\Some\path\to\file
+ var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime);
+ let parts;
+ if (appInfo.OS == "WINNT"){
+ parts = photoURL.split("\\");
+ } else {
+ parts = photoURL.split("/");
+ }
let lastPart = parts[parts.length-1];
- if (lastPart != "") {
- //on Windows, this is a absolute path. We only need the filename.
- parts = lastPart.split("\\");
- if(parts.length > 1)
- lastPart = parts[parts.length-1];
+ if (lastPart != "")
deletePhotoFile(lastPart, true);
- }
}
oldCard.deleteProperty("PhotoURI");
}
|
|
Patch is ok for 17.0.2 (see patch-file for tb17) |
|
|
Fix also pushed for tb17. See: https://github.com/inverse-inc/sogo-connector.tb17/commit/696c770e6716269966d54164c04706293aed967a And for tb10: https://github.com/inverse-inc/sogo-connector.tb10/commit/6520f09f4998d078cee0dc1229fcdbb5feae3c69 |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-11-26 13:49 | Stefan | New Issue | |
| 2012-11-26 13:49 | Stefan | File Added: sync.addressbook.groupdav.js.diff | |
| 2013-01-11 17:42 | ludovic | Note Added: 0005142 | |
| 2013-01-18 09:36 | Stefan | File Added: bug-2125.diff | |
| 2013-01-18 09:37 | Stefan | Note Added: 0005225 | |
| 2013-01-18 14:32 | ludovic | Note Added: 0005230 | |
| 2013-01-18 14:32 | ludovic | Status | new => closed |
| 2013-01-18 14:32 | ludovic | Resolution | open => fixed |