April 2011 Archives

ImageMagick的使用

    ImageMagick是一个图像处理软件,通过它可以编辑处理包括JPEG、TIFF、PNM、PNG、GIF和Photo CD在内的等当今最流行的图象格式,这里我们介绍一下其perl接口的PerlMagick的使用技巧。

    PerlMagick的模块名称叫Image::Magick,通过cpan网络可以搜索到它。

解决MT留言出错的问题

当用户在MT评论的时候,发现评论结束后出现“wide character in subroutine entry”的字样,虽然不影响最终的评论,但是旺旺给留言用户造成错觉,解决办法如下:
(1)找到plugins/Markdown/Markdown.pl文件:
在头中某处加上:
use Encode qw(encode_utf8);
在286行的位置,将
my $key = md5_hex($1);
替换成:
my $key = md5_hex(encode_utf8($1));
(2)找到extlib/MIME/EncWords.pm文件:
在头中某处加上:
use Encode qw(encode_utf8);
在176行的位置,找到
encode_base64($str, '');
encode_base64(encode_utf8($str), '');
即可。

一个twiki5.0的注册bug

    stlchina进行了升级, 发现注册用户不能正常激活,经过分析发现lib/TWiki/UI/Register.pm文件中,子函数register_cgi有一句:

$query->request_method() !~ /^POST$/i

但是经过测试发现,$query->request_method()一直是GET方式,于是简单fixed如下:

$query->request_method() !~ /^(POST|GET)$/i

就可以完成注册用户的激活。

Monthly Archives

Pages

Powered by Movable Type 7.7.2

About this Archive

This page is an archive of entries from April 2011 listed from newest to oldest.

March 2011 is the previous archive.

May 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.