From e39484e47bb3d664d75b2df63b7eda70980e0f1c Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 10 May 2015 19:20:38 +0200 Subject: [PATCH] Prevent empty log lines and a couple of include cleanups. --- admin/includes/fa_patch.class.inc | 2 +- includes/errors.inc | 2 +- includes/references.inc | 1 + includes/remote_url.inc | 3 +-- includes/session.inc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/includes/fa_patch.class.inc b/admin/includes/fa_patch.class.inc index c62417b9..1275898d 100644 --- a/admin/includes/fa_patch.class.inc +++ b/admin/includes/fa_patch.class.inc @@ -9,7 +9,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -include($path_to_root."/includes/packages.inc"); +include_once($path_to_root."/includes/packages.inc"); // // Utility class contains basic database upgrade routines. // diff --git a/includes/errors.inc b/includes/errors.inc index 1bf3b3bd..937270ea 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -79,7 +79,7 @@ function error_handler($errno, $errstr, $file, $line) { if (!in_array(array($errno, $errstr, $file, $line, @$bt), $messages)) $messages[] = array($errno, $errstr, $file, $line, @$bt); } - else if($errno&~E_NOTICE) { // log all not displayed messages + else if ($errno&~E_NOTICE && $errstr != '') { // log all not displayed messages $user = @$_SESSION["wa_current_user"]->loginname; $context = isset($SysPrefs) && !$SysPrefs->db_ok ? '[before upgrade]' : ''; error_log(user_company() . ":$user:". basename($file) .":$line:$context $errstr"); diff --git a/includes/references.inc b/includes/references.inc index a5e872d7..249dccf7 100644 --- a/includes/references.inc +++ b/includes/references.inc @@ -10,6 +10,7 @@ See the License here . ***********************************************************************/ include_once($path_to_root . "/includes/db/class.reflines_db.inc"); +include_once($path_to_root . "/includes/types.inc"); //--------------------------------------------------------------------------------------------- // 2.4 - further changes toward removing refs table introduced: // . all transactions now have references stored in trans table. diff --git a/includes/remote_url.inc b/includes/remote_url.inc index 0e53dbf4..4cb88e12 100644 --- a/includes/remote_url.inc +++ b/includes/remote_url.inc @@ -43,7 +43,6 @@ function url_get_contents($url, $timeout=10) } $response = ''; - // connect to the remote server $fp = @fsockopen($host, $port, $errno, $errstr, $timeout ); if( !$fp ) { @@ -67,7 +66,7 @@ function url_get_contents($url, $timeout=10) while ($line = fread($fp, 4096)) { $response .= $line; - if ($host=='localhost' && !$unblocked++) + if (strpos($host,'localhost') !== false && !$unblocked++) stream_set_blocking($fp, 0); // just after connection switch to nonblocking mode usleep(10); } diff --git a/includes/session.inc b/includes/session.inc index ad3978c2..e8b4b143 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -476,7 +476,7 @@ if (!defined('FA_LOGOUT_PHP_FILE')){ login_timeout(); if (!$_SESSION["wa_current_user"]->old_db) - include_once($path_to_root . '/company/'.user_company().'/installed_extensions.php'); + include($path_to_root . '/company/'.user_company().'/installed_extensions.php'); install_hooks(); -- 2.30.2