From 436bfd0c36026a110eaed737659d1ef62b66664a Mon Sep 17 00:00:00 2001 From: Stanislas Dolcini Date: Sat, 6 Oct 2018 14:44:53 +0200 Subject: [PATCH] Move function out of the class, as they should be global --- .../login/class/connection_handler.php | 50 +++---------------- code/web/public_php/login/r2_login.php | 16 ++---- code/web/public_php/login/tools/utils.php | 37 ++++++++++++++ 3 files changed, 48 insertions(+), 55 deletions(-) create mode 100644 code/web/public_php/login/tools/utils.php diff --git a/code/web/public_php/login/class/connection_handler.php b/code/web/public_php/login/class/connection_handler.php index bbe7aaf7f..7124cf94f 100644 --- a/code/web/public_php/login/class/connection_handler.php +++ b/code/web/public_php/login/class/connection_handler.php @@ -1,19 +1,12 @@ logStr(str_replace("\n", '\n', $buffer)); - } - return $buffer; // sent to output - } - - /** - * Callback called on error - */ - public function err_callback($errno, $errmsg, $filename, $linenum, $vars) - { - $logFile = new CWwwLog(); - $logFile->logStr('PHP ERROR/$errno $errmsg ($filename:$linenum)'); - $logFile->logStr('PHP CALLSTACK/' . print_r(debug_backtrace(), true)); - } - /** * @param string * the password to extract the salt from. diff --git a/code/web/public_php/login/r2_login.php b/code/web/public_php/login/r2_login.php index 936b3209a..834d94f35 100755 --- a/code/web/public_php/login/r2_login.php +++ b/code/web/public_php/login/r2_login.php @@ -1,19 +1,11 @@ logStr(str_replace("\n", '\n', $buffer)); + } + return $buffer; // sent to output +} + +/** + * Callback called on error + */ +function err_callback($errno, $errmsg, $filename, $linenum, $vars) +{ + $logFile = new CWwwLog(); + $logFile->logStr('PHP ERROR/$errno $errmsg ($filename:$linenum)'); + $logFile->logStr('PHP CALLSTACK/' . print_r(debug_backtrace(), true)); +}