Author:   Lars Michelsen <[email protected]>
Date:     Fri Oct 28 01:12:46 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Fri Oct 28 01:12:46 2011 +0200

Bugfix: Fixed problem with some PHP 5.1.2 installations while reading
the map configuration files

---

 ChangeLog                                  |    2 ++
 share/server/core/classes/GlobalMapCfg.php |   10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 22787f1..941051f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@ Core
   * Bugfix: Fixed inclusion problem of default settings in some rare cases
   * Added workaround for the annoying PHP warning which occurs on some systems:
     It is not safe to rely on the system's timezone settings
+  * Bugfix: Fixed problem with some PHP 5.1.2 installations while reading the
+    map configuration files
 
 1.6rc3
 Core
diff --git a/share/server/core/classes/GlobalMapCfg.php 
b/share/server/core/classes/GlobalMapCfg.php
index 02f2d49..84a6007 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -276,7 +276,15 @@ class GlobalMapCfg {
                 return false;
 
             // Read file in array (Don't read empty lines and ignore new line 
chars)
-            $file = file($this->configFile, FILE_SKIP_EMPTY_LINES | 
FILE_IGNORE_NEW_LINES);
+            //$file = file($this->configFile, FILE_SKIP_EMPTY_LINES | 
FILE_IGNORE_NEW_LINES);
+            // Calling file() with "FILE_SKIP_EMPTY_LINES | 
FILE_IGNORE_NEW_LINES" caused strange
+            // problems with PHP 5.1.2 while testing with e.g. SLES10SP1. So 
added that workaround
+            // here.
+            if(version_compare(PHP_VERSION, '5.1.2', '==')) {
+                $cfgFile = file($this->configFile);
+            } else { 
+                $cfgFile = file($this->configFile, FILE_SKIP_EMPTY_LINES | 
FILE_IGNORE_NEW_LINES);
+            }
 
             // Create an array for these options
             $createArray = Array('use' => 1);


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to