This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Trap Value
#2

Ok, this is for Commentics v1.3.5

In comments/includes/app/processor.php, replace this:
PHP Code:
<?php 
/* Check Trap */
if ($settings->check_trap) {
if (!isset(
$_POST['fax']) || !isset($_POST['phone'])) { //no trap data submitted
cmtx_ban(CMTX_BAN_REASON_NO_TRAP); //ban user for no trap data
} else { //if trap data submitted
if (!empty($_POST['fax']) || !empty($_POST['phone'])) { //trap data contains value
cmtx_ban(CMTX_BAN_REASON_TRAP_VALUE); //ban user for trap value
}
}
}

With:
PHP Code:
<?php 
/* Check Trap */
if ($settings->check_trap) {
global
$fax, $phone;
if (!isset(
$_POST['fax']) || !isset($_POST['phone'])) { //no trap data submitted
cmtx_ban(CMTX_BAN_REASON_NO_TRAP); //ban user for no trap data
} else { //if trap data submitted
if (!empty($_POST['fax']) || !empty($_POST['phone'])) { //trap data contains value
if (!empty($_POST['fax'])) { $fax = $_POST['fax']; }
if (!empty(
$_POST['phone'])) { $phone = $_POST['phone']; }
cmtx_ban(CMTX_BAN_REASON_TRAP_VALUE); //ban user for trap value
}
}
}

Then, in comments/includes/functions/processor.php, replace this:
PHP Code:
<?php 
function cmtx_ban ($reason) { //ban user

global $mysql_table_prefix, $settings, $ip_address, $is_admin; //globalise variables

With:
PHP Code:
<?php 
function cmtx_ban ($reason) { //ban user

global $mysql_table_prefix, $settings, $ip_address, $is_admin, $fax, $phone; //globalise variables

if ($reason == CMTX_BAN_REASON_TRAP_VALUE && strlen($fax) < 100 && strlen($phone) < 100) {
$fax = cmtx_sanitize($fax, true, true, true);
$phone = cmtx_sanitize($phone, true, true, true);
$reason .= " Fax: \"" . $fax . "\" Phone: \"" . $phone . "\"";
}

Have you completed the interview?
Reply


Messages In This Thread
Trap Value - by Chafik - 25-Jan-2011, 02:16 PM
RE: Trap Value - by Steven - 25-Jan-2011, 05:19 PM
RE: Trap Value - by Norbs - 15-Jun-2011, 05:22 AM
RE: Trap Value - by Norbs - 15-Jun-2011, 09:21 PM
RE: Trap Value - by Jordann - 06-Feb-2012, 10:24 PM
RE: Trap Value - by Steven - 07-Feb-2012, 03:00 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)