X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=ref.php;h=7edc3ed7d09c6ac434b7110393415e529fb51ed6;hb=80e2def8ef2125fd4d7d1312ee3993ab613f0846;hp=26e6087fe198b8e85b131eb31628497fe605b766;hpb=60494e212a67fe360bfbb481eb4928480a6f379b;p=mailer.git diff --git a/ref.php b/ref.php index 26e6087fe1..7edc3ed7d0 100644 --- a/ref.php +++ b/ref.php @@ -45,7 +45,7 @@ $GLOBALS['module'] = "ref"; $CSS = -1; require ("inc/config.php"); // Redirect only to registration page when this script is installed -if (defined('mxchange_installed') && (mxchange_installed)) +if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed'))) { // Base URL for redirection switch ($_CONFIG['refid_target']) @@ -60,7 +60,7 @@ if (defined('mxchange_installed') && (mxchange_installed)) } // Get referral ID from ref or refid variable - if (!empty($_GET['ref'])) $ref = strip_tags(htmlentities($_GET['ref'])); + if (!empty($_GET['ref'])) $ref = secureString($_GET['ref']); elseif (!empty($_GET['refid'])) $ref = bigintval($_GET['refid']); if (!empty($ref)) @@ -74,6 +74,7 @@ if (defined('mxchange_installed') && (mxchange_installed)) list($ref) = SQL_FETCHROW($result); SQL_FREERESULT($result); } + // Also edit this 0 ! if (empty($ref)) $ref = "0"; @@ -81,7 +82,7 @@ if (defined('mxchange_installed') && (mxchange_installed)) $URL .= bigintval($ref); // Update ref counter - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET ref_clicks=ref_clicks+1 WHERE userid=%d LIMIT 1", + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET ref_clicks=ref_clicks+1 WHERE userid=%s LIMIT 1", array(bigintval($ref)), __FILE__, __LINE__); } else