Prevent empty log lines and a couple of include cleanups.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 10 May 2015 17:20:38 +0000 (19:20 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 10 May 2015 17:36:32 +0000 (19:36 +0200)
admin/includes/fa_patch.class.inc
includes/errors.inc
includes/references.inc
includes/remote_url.inc
includes/session.inc

index c62417b98efa85a4cedb07cb9764802011427602..1275898d08b4f76a9b4bc1955969ff58ade3115a 100644 (file)
@@ -9,7 +9,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-include($path_to_root."/includes/packages.inc");
+include_once($path_to_root."/includes/packages.inc");
 //
 //     Utility class contains basic database upgrade routines.
 //
index 1bf3b3bdeb37235af8f69a5ba7f1719b28cbbffd..937270eac3f4c5149371710f5f8ba9cdd48b8458 100644 (file)
@@ -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");
index a5e872d703e0dcee08afefff37dae24e039c29c0..249dccf7cf53bdd263083e57e7ebb33552193dfa 100644 (file)
@@ -10,6 +10,7 @@
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 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.
index 0e53dbf466eab1cc32445cd9ca935f1d8c919504..4cb88e12d1fbfb91d4e97caee58b1a67599b6144 100644 (file)
@@ -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);
                }
index ad3978c27df990184058915412795db7b0a5e936..e8b4b1437259e9a210cb06ec7b243b0590df683e 100644 (file)
@@ -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();