--- nfo/php/libs/net.php.smarty/Config_File.class.php 2002/10/09 00:45:29 1.1 +++ nfo/php/libs/net.php.smarty/Config_File.class.php 2002/12/19 16:40:20 1.2 @@ -3,7 +3,7 @@ /** * Config_File class. * - * @version 2.3.0 + * @version 2.3.1 * @author Andrei Zmievski * @access public * @@ -60,6 +60,14 @@ */ var $read_hidden = true; + /** + * Controls whether or not to fix mac or dos formatted newlines. + * If set to true, \r or \r\n will be changed to \n. + * + * @access public + */ + var $fix_newlines = true; + /* Private variables */ var $_config_path = ""; var $_config_data = array(); @@ -253,6 +261,11 @@ $contents = fread($fp, filesize($config_file)); fclose($fp); + + if($this->fix_newlines) { + // fix mac/dos formatted newlines + $contents = preg_replace('!\r\n?!',"\n",$contents); + } $config_data = array();