-
Notifications
You must be signed in to change notification settings - Fork 3
/
sk_captcha_graphic.php
44 lines (36 loc) · 1.47 KB
/
sk_captcha_graphic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**********************************************************************************************
Spam Karma (c) 2015 - http://github.com/strider72/spam-karma
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
************************************************************************************************/
?><?php
header("Content-type: image/png");
global $sk_log, $wpdb;
require_once('../../../wp-config.php');
include_once(dirname(__FILE__) . "/sk_core_class.php");
$comment_ID = (int) @$_REQUEST['c_id'];
$author_email = @$_REQUEST['c_author'];
$sk_log->live_output = false;
$this_cmt = new sk_comment ($comment_ID);
if (@$this_cmt->ID && ($author_email == $this_cmt->author_email))
{
foreach($this_cmt->unlock_keys as $key)
if ($key['class'] == "sk_captcha_plugin")
$string = strtoupper($key['key']);
}
else
$string = __("Invalid ID", 'spam-karma');
$im = imagecreate(150, 50);
$bg = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 6, 10, 10, $string, $red);
imagepng($im);
imagedestroy($im);
?>