Skip to content

Commit

Permalink
Merge branch 'hotfix-1.13.12'
Browse files Browse the repository at this point in the history
* hotfix-1.13.12:
  Update version info.
  trade: fix duplicated folder creation
  core: escapeFileName() now escapes standalone "%"s
  core: fix files with a leading dot loses extension
  • Loading branch information
danny0838 committed Jul 8, 2017
2 parents 9bf5d72 + 62bdf6d commit 07cdfe2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
6 changes: 4 additions & 2 deletions chrome/content/scrapbook/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,10 @@ var sbImportService = {
if ( this.tarResArray[0] != window.top.sbTreeHandler.TREE.ref ) folder = " [" + item.folder + "] ";
}
var curRes = sbDataSource.addItem(item, this.tarResArray[0], this.tarResArray[1]);
if (item.container || item.type == "folder") sbDataSource.createEmptySeq(curRes.Value);
this.folderTable[item.title] = curRes.Value;
if (item.container || item.type == "folder") {
sbDataSource.createEmptySeq(curRes.Value);
this.folderTable[item.title] = curRes.Value;
}
window.top.sbTreeHandler.TREE.builder.rebuild();
},

Expand Down
14 changes: 14 additions & 0 deletions doc/releases/1.13.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Scrapbook X 1.13.12
===================

Changes since v1.13.11
----------------------

* Fixed an issue that a file named ".foo" be fixed to "foo" and
loses its extension.

* Persent chars ("%") in a filename are now always encoded in URL.

* Fixed an issue that a non-folder item with a same name with a
folder before it causes the import wizard to generated a duplicated
folder.
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:type>2</em:type>
<em:version>1.13.11</em:version>
<em:version>1.13.12</em:version>
<em:unpack>false</em:unpack>
<em:bootstrap>false</em:bootstrap>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
Expand Down
4 changes: 2 additions & 2 deletions modules/common.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -880,14 +880,14 @@ var sbCommonUtils = {
escapeFileName: function(aString) {
// " ": breaks srcset
// "#": as the demarcation of main location and hash
return aString.replace(/(?:[ #]|%[0-9A-Fa-f]{2})+/g, function(m){return encodeURIComponent(m);});
return aString.replace(/[ %#]+/g, function(m){return encodeURIComponent(m);});
},

// Tidy chars that may not be valid in a filename on a platform.
// see also: escapeFileName
validateFileName: function(aFileName) {
aFileName = aFileName.replace(/[\x00-\x1F\x7F]+|^ +/g, "");
aFileName = aFileName.replace(/^[. ]+/, "").replace(/[. ]+$/, ""); // leading/trailing spaces and dots are not allowed in Windows
aFileName = aFileName.replace(/^\./, "_.").replace(/^ +/, "").replace(/[. ]+$/, ""); // leading/trailing spaces and dots are not allowed in Windows
aFileName = aFileName.replace(/[\"\?\*\\\/\|\:]/g, "_");
aFileName = aFileName.replace(/[\<]/g, "(");
aFileName = aFileName.replace(/[\>]/g, ")");
Expand Down

0 comments on commit 07cdfe2

Please sign in to comment.