From 33e2c95c69b405f36caf9013ff9a256e6edf9500 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 11 Feb 2013 08:15:44 -0500
Subject: [PATCH] - htpasswd_stats file was not readable for apache user.

---
 server/lib/classes/ini_parser.inc.php |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/server/lib/classes/ini_parser.inc.php b/server/lib/classes/ini_parser.inc.php
index 349990f..003d04c 100644
--- a/server/lib/classes/ini_parser.inc.php
+++ b/server/lib/classes/ini_parser.inc.php
@@ -1,7 +1,7 @@
 <?php
 
 /*
-Copyright (c) 2006, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
@@ -28,7 +28,7 @@
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-class ini_parser {
+class ini_parser{
 
 	var $config;
 
@@ -37,9 +37,8 @@
 		$lines = explode("\n",$ini);
 		
 		foreach($lines as $line) {
-			
+			$line = trim($line);
 			if($line != '') {
-				$line = trim($line);
 				if(preg_match("/^\[([\w\d_]+)\]$/", $line, $matches)) {
 					$section = strtolower($matches[1]);
 				} elseif(preg_match("/^([\w\d_]+)=(.*)$/", $line, $matches) && $section != null) {
@@ -58,7 +57,11 @@
 		foreach($this->config as $section => $data) {
 			$content .= "[$section]\n";
 			foreach($data as $item => $value) {
-				if($value != '') $content .= "$item=$value\n";
+				if($value != '') {
+					$value 	= trim($value);
+					$item 	= trim($item);
+					$content .= "$item=$value\n";
+				}
 			}
 		}
 		return $content;
@@ -66,4 +69,4 @@
 
 }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1