X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Flibs%2Fsponsor_functions.php;h=ff25ea405a28f74e7842f761a1e48e1b16e27bc2;hb=cd7d344ea7007cfa20413acd3e03e50f0ab86d86;hp=36bb1a990bc40bec87d4f4729b62d637fe2a8725;hpb=1d22c70e65e858422ee0d17a7612f4b5c0757a42;p=mailer.git diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 36bb1a990b..ff25ea405a 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -667,7 +667,7 @@ function fetchSponsorData ($sponsor_id, $column = 'id') { setCurrentSponsorId($sponsor_id); // Don't look for invalid sponsor_ids... - if (!isValidUserId($sponsor_id)) { + if (!isValidId($sponsor_id)) { // Invalid, so abort here reportBug(__FUNCTION__, __LINE__, 'Sponsor id ' . $sponsor_id . ' is invalid.'); } elseif (isSponsorDataValid()) { @@ -750,7 +750,7 @@ function getFetchedSponsorData ($keyColumn, $sponsor_id, $valueColumn) { $data = ''; // Can we fetch the sponsor data? - if ((isValidSponsorId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) { + if ((isValidId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) { // Now get the data back $data = getSponsorData($valueColumn); } // END - if @@ -803,25 +803,13 @@ function getCurrentSponsorId () { // Checks if current sponsor_id is set function isCurrentSponsorIdSet () { - return ((isset($GLOBALS['current_sponsor_id'])) && (isValidSponsorId($GLOBALS['current_sponsor_id']))); -} - -// Is given sponsor_id valid? -function isValidSponsorId ($sponsor_id) { - // Is there cache? - if (!isset($GLOBALS[__FUNCTION__][$sponsor_id])) { - // Check it out - $GLOBALS[__FUNCTION__][$sponsor_id] = ((!is_null($sponsor_id)) && (!empty($sponsor_id)) && ($sponsor_id > 0)); - } // END - if - - // Return cache - return $GLOBALS[__FUNCTION__][$sponsor_id]; + return ((isset($GLOBALS['current_sponsor_id'])) && (isValidId($GLOBALS['current_sponsor_id']))); } // Getter for sponsor data function getSponsorData ($column) { // Sponsor id should not be zero - if (!isValidUserId(getCurrentSponsorId())) { + if (!isValidId(getCurrentSponsorId())) { reportBug(__FUNCTION__, __LINE__, 'Sponsor id is zero.'); } // END - if