Fixed SCode install for 3.12
Dec 3, 2004The instructions for installing [James Seng’s CAPTCHA
module](http://james.seng.cc/archives/000145.html) for MovableType 3.x
were incomplete. You need to also edit the `/lib/MT/App/Comments.pm`
module
to perform the security check itself. This is the same trivial code
insert as
in pre-3.x releases:
sub post {
…
require MT::Blog;
my $blog =
MT::Blog~~[load($entry]{style=“text-align:right;”}~~>blog_id);
if (!$q->param(’text’)) {
return
$app~~[handle_error($app]{style=“text-align:right;”}~~>translate(“Comment
text is required.”));
}
#
# Security Code hack
#
require MT::SCode;
my $code = $q->param(‘code’);
my $scode = $q->param(‘scode’);
my $sscode = MT::SCode::scode_get($code);
if ($scode ne $sscode) {
return
$app~~[handle_error($app]{style=“text-align:right;”}~~>translate(
“Wrong or missing Security Code.”));
}
MT::SCode::scode_delete($code);
MT::SCode::scode_create($code);
#
# End Security Code hack
#
my ($comment, $commenter) = _make_comment($app, $entry);
if (!$blog->allow_unreg_comments) {
…
Save it and that’s all there is to it.