X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fwernis_functions.php;h=a7ff74f1dedc4e5abd04a42ccd44811fa390ce47;hb=36c3c8b749a88ce05ad0fda81e00047f9cb5433f;hp=56302d59e66111f31ec5a272116ca2c2fa10f152;hpb=7b0f17cd637e388049d2167811e4332cec1e979b;p=mailer.git
diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php
index 56302d59e6..a7ff74f1de 100644
--- a/inc/libs/wernis_functions.php
+++ b/inc/libs/wernis_functions.php
@@ -43,9 +43,9 @@ if (!defined('__SECURITY')) {
}
// Sets a status message and code
-function WERNIS_STATUS_MESSAGE ($msg, $status) {
- $GLOBALS['wernis_data']['message'] = $msg;
- $GLOBALS['wernis_data']['status'] = $status;
+function WERNIS_STATUS_MESSAGE ($message, $status) {
+ $GLOBALS['wernis_data']['message'] = $message;
+ $GLOBALS['wernis_data']['status'] = $status;
}
// Get the status message
@@ -113,7 +113,13 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
} // END - if
// All (maybe) fine so remove the response header from server
- $response = $response[(count($response) - 1)];
+ for ($idx = (count($response) - 1); $idx > 1; $idx--) {
+ $line = trim($response[$idx]);
+ if (!empty($line)) {
+ $response = $line;
+ break;
+ }
+ }
// Prepare the returning result for higher functions
if (substr($response, 0, 1) == '&') {
@@ -333,7 +339,7 @@ function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '',
// Take fees and factor
function WERNIS_TAKE_FEE ($points, $mode) {
// Payout or withdraw are allowed modes!
- //* DEBUG: */ echo "mode={$mode},points={$points}
\n";
+ //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}
");
if (!in_array($mode, array('payout', 'withdraw'))) {
// Log error and abort
DEBUG_LOG(__FUNCTION__, __LINE__, "uid={getUserId()},mode={$mode},points={$points}");
@@ -359,7 +365,7 @@ function WERNIS_TAKE_FEE ($points, $mode) {
}
// Return value
- //* DEBUG: */ echo "mode={$mode},points={$points}
\n";
+ //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}
");
return $points;
}
@@ -383,7 +389,7 @@ function WERNIS_ADD_FEES_TO_ARRAY (&$array) {
// Is the array an array? ;-)
if (!is_array($array)) {
// Log error and return
- DEBUG_LOG(__FUNCTION__, __LINE__, ' Type '.gettype($array).'!=array.');
+ DEBUG_LOG(__FUNCTION__, __LINE__, 'Type ' . gettype($array) . ' != array.');
return;
} // END - if