Skip to content

Commit

Permalink
update version to v1.1.10
Browse files Browse the repository at this point in the history
1. fix bug when the password is number.
  • Loading branch information
D0n9X1n committed Dec 23, 2016
1 parent df6f292 commit aeeacb2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
1.~~hexo g will not work when the config file with no blogs block.~~
2.~~if blog content has special character, it will crush.~~
3.~~if no toc div the decrypt will throw a exception.~~
4.~~if the password is numbers, the encrypt lib will crush.~~
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ hexo.extend.filter.register("after_post_render", function (data) {
data.content = escape(data.content);
data.content = CryptoJS.enc.Utf8.parse(data.content);
data.content = CryptoJS.enc.Base64.stringify(data.content);
data.content = CryptoJS.AES.encrypt(data.content, data.password).toString();
data.content = CryptoJS.AES.encrypt(data.content, String(data.password)).toString();
data.content = data.template.replace('{{content}}', data.content);
data.content = '<span id="encrypt-message">' + data.message + '</span>' + data.content;
data.content = '<script src="' + hexo.config.root + 'mcommon.js"></script>' + data.content;
Expand Down
2 changes: 1 addition & 1 deletion lib/mcommon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function decryptAES() {
var pass = document.getElementById("pass").value;
var pass = String(document.getElementById("pass").value);
try {
var content = CryptoJS.AES.decrypt(document.getElementById("encrypt-blog").innerHTML.trim(), pass);
content = content.toString(CryptoJS.enc.Utf8);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.1.9"
"version": "1.1.10"
}

0 comments on commit aeeacb2

Please sign in to comment.