diff options
| -rw-r--r-- | debian/patches/0004-rewrite-email-gravater.lua-using-md5.patch | 38 | ||||
| -rw-r--r-- | debian/patches/series | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/0004-rewrite-email-gravater.lua-using-md5.patch b/debian/patches/0004-rewrite-email-gravater.lua-using-md5.patch new file mode 100644 index 0000000..8119c07 --- /dev/null +++ b/debian/patches/0004-rewrite-email-gravater.lua-using-md5.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From: YAEGASHI Takeshi <yaegashi@debian.org> | ||
| 2 | Date: Thu, 20 Feb 2014 03:12:26 +0900 | ||
| 3 | Subject: rewrite email-gravater.lua using md5 | ||
| 4 | |||
| 5 | Unfortunately luacrypto is unavailable in Debian. Use lua-md5 instead. | ||
| 6 | --- | ||
| 7 | filters/email-gravatar.lua | 10 +++++----- | ||
| 8 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 9 | |||
| 10 | diff --git a/filters/email-gravatar.lua b/filters/email-gravatar.lua | ||
| 11 | index 52cf426..8f985f1 100644 | ||
| 12 | --- a/filters/email-gravatar.lua | ||
| 13 | +++ b/filters/email-gravatar.lua | ||
| 14 | @@ -3,19 +3,19 @@ | ||
| 15 | -- prefix in filters. It is much faster than the corresponding python script. | ||
| 16 | -- | ||
| 17 | -- Requirements: | ||
| 18 | --- luacrypto >= 0.3 | ||
| 19 | --- <http://mkottman.github.io/luacrypto/> | ||
| 20 | +-- md5 | ||
| 21 | +-- <http://keplerproject.org/md5/> | ||
| 22 | -- | ||
| 23 | |||
| 24 | -local crypto = require("crypto") | ||
| 25 | +local md5 = require("md5") | ||
| 26 | |||
| 27 | function filter_open(email, page) | ||
| 28 | buffer = "" | ||
| 29 | - md5 = crypto.digest("md5", email:sub(2, -2):lower()) | ||
| 30 | + digest = md5.sumhexa(email:sub(2, -2):lower()) | ||
| 31 | end | ||
| 32 | |||
| 33 | function filter_close() | ||
| 34 | - html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer) | ||
| 35 | + html("<img src='//www.gravatar.com/avatar/" .. digest .. "?s=13&d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer) | ||
| 36 | return 0 | ||
| 37 | end | ||
| 38 | |||
diff --git a/debian/patches/series b/debian/patches/series index efbdfb6..11ceafc 100644 --- a/debian/patches/series +++ b/debian/patches/series | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | 0001-make-a2x-skip-xmllint.patch | 1 | 0001-make-a2x-skip-xmllint.patch |
| 2 | 0002-introduce-debian-standard-build-flags.patch | 2 | 0002-introduce-debian-standard-build-flags.patch |
| 3 | 0003-pkg-config-lua5.1.patch | 3 | 0003-pkg-config-lua5.1.patch |
| 4 | 0004-rewrite-email-gravater.lua-using-md5.patch | ||
