tbrehm
2010-09-26 89e4554cb0bbf4b515f1e9f4ec6d48d0a95706c5
server/lib/classes/ini_parser.inc.php
@@ -37,9 +37,8 @@
      $lines = explode("\n",$ini);
      
      foreach($lines as $line) {
         if($line != '') {
            $line = trim($line);
         if($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;