Some sweeping syntax changes for consistency:

(! foo) changed to ( ! foo)
|| changed to OR
changed newline standardization code in various places from preg_replace to str_replace
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index 837e41f..faa9037 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -39,11 +39,11 @@
  * @param	mixed

  * @return	mixed	depends on what the array contains

  */	

-if (! function_exists('element'))

+if ( ! function_exists('element'))

 {

 	function element($item, $array, $default = FALSE)

 	{

-		if (! isset($array[$item]) OR $array[$item] == "")

+		if ( ! isset($array[$item]) OR $array[$item] == "")

 		{

 			return $default;

 		}

@@ -61,11 +61,11 @@
  * @param	array

  * @return	mixed	depends on what the array contains

  */	

-if (! function_exists('random_element'))

+if ( ! function_exists('random_element'))

 {

 	function random_element($array)

 	{

-		if (! is_array($array))

+		if ( ! is_array($array))

 		{

 			return $array;

 		}

@@ -73,6 +73,6 @@
 	}	

 }

 

-
-/* End of file array_helper.php */
+

+/* End of file array_helper.php */

 /* Location: ./system/helpers/array_helper.php */
\ No newline at end of file
diff --git a/system/helpers/compatibility_helper.php b/system/helpers/compatibility_helper.php
index 076f677..077ac67 100644
--- a/system/helpers/compatibility_helper.php
+++ b/system/helpers/compatibility_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *
@@ -35,7 +35,7 @@
 
 // ------------------------------------------------------------------------
 
-if (! defined('PHP_EOL'))
+if ( ! defined('PHP_EOL'))
 {
 	define('PHP_EOL', (DIRECTORY_SEPARATOR == '/') ? "\n" : "\r\n");
 } 
@@ -55,7 +55,7 @@
  * @param	int			flags
  * @return	int			length of written string
  */
-if (! function_exists('file_put_contents'))
+if ( ! function_exists('file_put_contents'))
 {
 	function file_put_contents($filename, $data, $flags = NULL)
 	{
@@ -64,7 +64,7 @@
 			settype($data, 'STRING');
 		}
 
-		if (! is_string($data) && ! is_array($data) && ! is_resource($data))
+		if ( ! is_string($data) && ! is_array($data) && ! is_resource($data))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'file_put_contents(): the 2nd parameter should be either a string or an array', $backtrace[0]['file'], $backtrace[0]['line']);
@@ -83,7 +83,7 @@
 
 			$text = '';
 			
-			while (! feof($data))
+			while ( ! feof($data))
 			{
 				$text .= fread($data, 4096);
 			}
@@ -129,7 +129,7 @@
 	
 		if (($flags & LOCK_EX) > 0)
 		{
-			if (! flock($fp, LOCK_EX))
+			if ( ! flock($fp, LOCK_EX))
 			{
 				$backtrace = debug_backtrace();
 				_exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') unable to acquire an exclusive lock on file', $backtrace[0]['file'], $backtrace[0]['line']);
@@ -167,12 +167,12 @@
  * @param	string		enclosure
  * @return	int			length of written string
  */
-if (! function_exists('fputcsv'))
+if ( ! function_exists('fputcsv'))
 {
 	function fputcsv($handle, $fields, $delimiter = ',', $enclosure = '"')
 	{
 		// Checking for a handle resource
-		if (! is_resource($handle))
+		if ( ! is_resource($handle))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 1 to be stream resource, '.gettype($handle).' given', $backtrace[0]['file'], $backtrace[0]['line']);
@@ -188,7 +188,7 @@
 		}
 	
 		// Checking for an array of fields
-		if (! is_array($fields))
+		if ( ! is_array($fields))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 2 to be array, '.gettype($fields).' given', $backtrace[0]['file'], $backtrace[0]['line']);
@@ -218,7 +218,7 @@
 		{
 			$cell = str_replace($enclosure, $enclosure.$enclosure, $cell);
 
-			if (strpos($cell, $delimiter) !== FALSE || strpos($cell, $enclosure) !== FALSE || strpos($cell, "\n") !== FALSE)
+			if (strpos($cell, $delimiter) !== FALSE OR strpos($cell, $enclosure) !== FALSE OR strpos($cell, "\n") !== FALSE)
 			{
 				$out .= $enclosure.$cell.$enclosure.$delimiter;
 			}
@@ -248,7 +248,7 @@
  * @param	int			offset
  * @return	int			numeric position of the first occurrence of needle in the haystack
  */
-if (! function_exists('stripos'))
+if ( ! function_exists('stripos'))
 {
 	function stripos($haystack, $needle, $offset = NULL)
 	{
@@ -258,14 +258,14 @@
 			settype($haystack, 'STRING');
 		}
 	
-		if (! is_string($haystack))
+		if ( ! is_string($haystack))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'stripos() expects parameter 1 to be string, '.gettype($haystack).' given', $backtrace[0]['file'], $backtrace[0]['line']);
 			return FALSE;
 		}
 	
-		if (! is_scalar($needle))
+		if ( ! is_scalar($needle))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'stripos() needle is not a string or an integer in '.$backtrace[0]['file'], $backtrace[0]['line']);
@@ -277,7 +277,7 @@
 			$offset = (int)$offset;
 		}
 	
-		if (! is_int($offset) && ! is_bool($offset) && ! is_null($offset))
+		if ( ! is_int($offset) && ! is_bool($offset) && ! is_null($offset))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'stripos() expects parameter 3 to be long, '.gettype($offset).' given', $backtrace[0]['file'], $backtrace[0]['line']);
@@ -304,12 +304,12 @@
  * @param	mixed		subject
  * @return	int			numeric position of the first occurrence of needle in the haystack
  */
-if (! function_exists('str_ireplace'))
+if ( ! function_exists('str_ireplace'))
 {
 	function str_ireplace($search, $replace, $subject)
 	{
 		// Nothing to do here
-		if ($search === NULL || $subject === NULL)
+		if ($search === NULL OR $subject === NULL)
 		{
 			return $subject;
 		}
@@ -376,7 +376,7 @@
 		$result = preg_replace($search, $replace, (array)$subject);
 	
 		// Check if subject was initially a string and return it as a string
-		if (! is_array($subject))
+		if ( ! is_array($subject))
 		{
 			return current($result);
 		}
@@ -400,12 +400,12 @@
  * @param	string		argument separator
  * @return	string		URL-encoded string
  */
-if (! function_exists('http_build_query'))
+if ( ! function_exists('http_build_query'))
 {
 	function http_build_query($formdata, $numeric_prefix = NULL, $separator = NULL)
 	{
 		// Check the data
-		if (! is_array($formdata) && ! is_object($formdata))
+		if ( ! is_array($formdata) && ! is_object($formdata))
 		{
 			$backtrace = debug_backtrace();
 			_exception_handler(E_USER_WARNING, 'http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given', $backtrace[0]['file'], $backtrace[0]['line']);
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index 7b8989e..8216226 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -42,7 +42,7 @@
  * @param	string	the cookie prefix

  * @return	void

  */

-if (! function_exists('set_cookie'))

+if ( ! function_exists('set_cookie'))

 {

 	function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '')

 	{

@@ -73,7 +73,7 @@
 			$path = $CI->config->item('cookie_path');

 		}

 		

-		if (! is_numeric($expire))

+		if ( ! is_numeric($expire))

 		{

 			$expire = time() - 86500;

 		}

@@ -103,7 +103,7 @@
  * @param	bool

  * @return	mixed

  */

-if (! function_exists('get_cookie'))

+if ( ! function_exists('get_cookie'))

 {

 	function get_cookie($index = '', $xss_clean = FALSE)

 	{

@@ -123,7 +123,7 @@
  * @param	string	the cookie prefix

  * @return	void

  */

-if (! function_exists('delete_cookie'))

+if ( ! function_exists('delete_cookie'))

 {

 	function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')

 	{

@@ -131,6 +131,6 @@
 	}

 }

 

-
-/* End of file cookie_helper.php */
+

+/* End of file cookie_helper.php */

 /* Location: ./system/helpers/cookie_helper.php */
\ No newline at end of file
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index c4f0e9a..095e460 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -35,7 +35,7 @@
  * @access	public

  * @return	integer

  */	

-if (! function_exists('now'))

+if ( ! function_exists('now'))

 {

 	function now()

 	{

@@ -80,7 +80,7 @@
  * @param	integer

  * @return	integer

  */	

-if (! function_exists('mdate'))

+if ( ! function_exists('mdate'))

 {

 	function mdate($datestr = '', $time = '')

 	{

@@ -107,7 +107,7 @@
  * @param	integer	Unix timestamp

  * @return	string

  */	

-if (! function_exists('standard_date'))

+if ( ! function_exists('standard_date'))

 {

 	function standard_date($fmt = 'DATE_RFC822', $time = '')

 	{

@@ -123,7 +123,7 @@
 						'DATE_W3C'		=>	'%Y-%m-%dT%H:%i:%s%Q'

 						);

 

-		if (! isset($formats[$fmt]))

+		if ( ! isset($formats[$fmt]))

 		{

 			return FALSE;

 		}

@@ -145,19 +145,19 @@
  * @param	integer	Unix timestamp

  * @return	integer

  */	

-if (! function_exists('timespan'))

+if ( ! function_exists('timespan'))

 {

 	function timespan($seconds = 1, $time = '')

 	{

 		$CI =& get_instance();

 		$CI->lang->load('date');

 

-		if (! is_numeric($seconds))

+		if ( ! is_numeric($seconds))

 		{

 			$seconds = 1;

 		}

 	

-		if (! is_numeric($time))

+		if ( ! is_numeric($time))

 		{

 			$time = time();

 		}

@@ -262,7 +262,7 @@
  * @param	integer	a numeric year

  * @return	integer

  */	

-if (! function_exists('days_in_month'))

+if ( ! function_exists('days_in_month'))

 {

 	function days_in_month($month = 0, $year = '')

 	{

@@ -271,7 +271,7 @@
 			return 0;

 		}

 	

-		if (! is_numeric($year) OR strlen($year) != 4)

+		if ( ! is_numeric($year) OR strlen($year) != 4)

 		{

 			$year = date('Y');

 		}

@@ -298,7 +298,7 @@
  * @param	integer Unix timestamp

  * @return	integer

  */	

-if (! function_exists('local_to_gmt'))

+if ( ! function_exists('local_to_gmt'))

 {

 	function local_to_gmt($time = '')

 	{

@@ -324,7 +324,7 @@
  * @param	bool	whether DST is active

  * @return	integer

  */	

-if (! function_exists('gmt_to_local'))

+if ( ! function_exists('gmt_to_local'))

 {

 	function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE)

 	{			

@@ -353,7 +353,7 @@
  * @param	integer Unix timestamp

  * @return	integer

  */	

-if (! function_exists('mysql_to_unix'))

+if ( ! function_exists('mysql_to_unix'))

 {

 	function mysql_to_unix($time = '')

 	{

@@ -390,7 +390,7 @@
  * @param	string	format: us or euro

  * @return	string

  */	

-if (! function_exists('unix_to_human'))

+if ( ! function_exists('unix_to_human'))

 {

 	function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us')

 	{

@@ -430,7 +430,7 @@
  * @param	string	format: us or euro

  * @return	integer

  */	

-if (! function_exists('human_to_unix'))

+if ( ! function_exists('human_to_unix'))

 {

 	function human_to_unix($datestr = '')

 	{

@@ -442,7 +442,7 @@
 		$datestr = trim($datestr);

 		$datestr = preg_replace("/\040+/", "\040", $datestr);

 

-		if (! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr))

+		if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr))

 		{

 			return FALSE;

 		}

@@ -501,7 +501,7 @@
  * @param	string	menu name

  * @return	string

  */	

-if (! function_exists('timezone_menu'))

+if ( ! function_exists('timezone_menu'))

 {

 	function timezone_menu($default = 'UTC', $class = "", $name = 'timezones')

 	{

@@ -544,7 +544,7 @@
  * @param	string	timezone

  * @return	string

  */	

-if (! function_exists('timezones'))

+if ( ! function_exists('timezones'))

 {

 	function timezones($tz = '')

 	{

@@ -592,10 +592,10 @@
 		if ($tz == 'GMT')

 			$tz = 'UTC';

 	

-		return (! isset($zones[$tz])) ? 0 : $zones[$tz];

+		return ( ! isset($zones[$tz])) ? 0 : $zones[$tz];

 	}

 }

 

-
-/* End of file date_helper.php */
+

+/* End of file date_helper.php */

 /* Location: ./system/helpers/date_helper.php */
\ No newline at end of file
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index d00bdf0..1bf694f 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -39,7 +39,7 @@
  * @param	bool	whether to limit the result to the top level only

  * @return	array

  */	

-if (! function_exists('directory_map'))

+if ( ! function_exists('directory_map'))

 {

 	function directory_map($source_dir, $top_level_only = FALSE)

 	{	

diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 2096fd8..53191c7 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -37,7 +37,7 @@
  * @param	mixed	the data to be downloaded

  * @return	void

  */	

-if (! function_exists('force_download'))

+if ( ! function_exists('force_download'))

 {

 	function force_download($filename = '', $data = '')

 	{

@@ -61,7 +61,7 @@
 		@include(APPPATH.'config/mimes'.EXT);

 	

 		// Set a default mime if we can't find it

-		if (! isset($mimes[$extension]))

+		if ( ! isset($mimes[$extension]))

 		{

 			$mime = 'application/octet-stream';

 		}

@@ -95,6 +95,6 @@
 	}

 }

 

-
-/* End of file download_helper.php */
+

+/* End of file download_helper.php */

 /* Location: ./system/helpers/download_helper.php */
\ No newline at end of file
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index 594a030..496d612 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -33,11 +33,11 @@
  * @access	public

  * @return	bool

  */	

-if (! function_exists('valid_email'))

+if ( ! function_exists('valid_email'))

 {

 	function valid_email($address)

 	{

-		return (! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;

+		return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;

 	}

 }

 

@@ -49,7 +49,7 @@
  * @access	public

  * @return	bool

  */	

-if (! function_exists('send_email'))

+if ( ! function_exists('send_email'))

 {

 	function send_email($recipient, $subject = 'Test email', $message = 'Hello World')

 	{

@@ -57,6 +57,6 @@
 	}

 }

 

-
-/* End of file email_helper.php */
+

+/* End of file email_helper.php */

 /* Location: ./system/helpers/email_helper.php */
\ No newline at end of file
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index fac916f..0d33fe3 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -36,11 +36,11 @@
  * @param	string	path to file

  * @return	string

  */	

-if (! function_exists('read_file'))

+if ( ! function_exists('read_file'))

 {

 	function read_file($file)

 	{

-		if (! file_exists($file))

+		if ( ! file_exists($file))

 		{

 			return FALSE;

 		}

@@ -50,7 +50,7 @@
 			return file_get_contents($file);		

 		}

 

-		if (! $fp = @fopen($file, FOPEN_READ))

+		if ( ! $fp = @fopen($file, FOPEN_READ))

 		{

 			return FALSE;

 		}

@@ -83,11 +83,11 @@
  * @param	string	file data

  * @return	bool

  */	

-if (! function_exists('write_file'))

+if ( ! function_exists('write_file'))

 {

 	function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE)

 	{

-		if (! $fp = fopen($path, $mode))

+		if ( ! $fp = fopen($path, $mode))

 		{

 			return FALSE;

 		}

@@ -116,14 +116,14 @@
  * @param	bool	whether to delete any directories found in the path

  * @return	bool

  */	

-if (! function_exists('delete_files'))

+if ( ! function_exists('delete_files'))

 {

 	function delete_files($path, $del_dir = FALSE, $level = 0)

 	{	

 		// Trim the trailing slash

 		$path = preg_replace("|^(.+?)/*$|", "\\1", $path);

 		

-		if (! $current_dir = @opendir($path))

+		if ( ! $current_dir = @opendir($path))

 			return;

 	

 		while(FALSE !== ($filename = @readdir($current_dir)))

@@ -163,7 +163,7 @@
  * @param	bool	internal variable to determine recursion status - do not use in calls

  * @return	array

  */	

-if (! function_exists('get_filenames'))

+if ( ! function_exists('get_filenames'))

 {

 	function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE)

 	{

@@ -215,7 +215,7 @@
  * @param	bool	internal variable to determine recursion status - do not use in calls

  * @return	array

  */	

-if (! function_exists('get_dir_file_info'))

+if ( ! function_exists('get_dir_file_info'))

 {

 	function get_dir_file_info($source_dir, $include_path = FALSE, $_recursion = FALSE)

 	{

@@ -267,12 +267,12 @@
 * @param    mixed    array or comma separated string of information returned

 * @return    array

 */    

-if (! function_exists('get_file_info'))

+if ( ! function_exists('get_file_info'))

 {

     function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))

     {

 

-        if (! file_exists($file))

+        if ( ! file_exists($file))

         {

             return FALSE;

         }

@@ -333,7 +333,7 @@
  * @param	string	path to file

  * @return	mixed

  */	

-if (! function_exists('get_mime_by_extension'))

+if ( ! function_exists('get_mime_by_extension'))

 {

 	function get_mime_by_extension($file)

 	{

@@ -341,9 +341,9 @@
 	

 		global $mimes;

 	

-		if (! is_array($mimes))

+		if ( ! is_array($mimes))

 		{

-			if (! require_once(APPPATH.'config/mimes.php'))

+			if ( ! require_once(APPPATH.'config/mimes.php'))

 			{

 				return FALSE;

 			}

@@ -380,7 +380,7 @@
  * @param	int

  * @return	string

  */	

-if (! function_exists('symbolic_permissions'))

+if ( ! function_exists('symbolic_permissions'))

 {

 	function symbolic_permissions($perms)

 	{	

@@ -448,7 +448,7 @@
  * @param	int

  * @return	string

  */	

-if (! function_exists('octal_permissions'))

+if ( ! function_exists('octal_permissions'))

 {

 	function octal_permissions($perms)

 	{

@@ -456,6 +456,6 @@
 	}

 }

 

-
-/* End of file file_helper.php */
+

+/* End of file file_helper.php */

 /* Location: ./system/helpers/file_helper.php */
\ No newline at end of file
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 541ab84..c6aa0d2 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -38,7 +38,7 @@
  * @param	array	a key/value pair hidden data

  * @return	string

  */	

-if (! function_exists('form_open'))

+if ( ! function_exists('form_open'))

 {

 	function form_open($action = '', $attributes = array(), $hidden = array())

 	{

@@ -48,7 +48,7 @@
 

 		$form = '<form action="'.$action.'"';

 	

-		if (! isset($attributes['method']))

+		if ( ! isset($attributes['method']))

 		{

 			$form .= ' method="post"';

 		}

@@ -85,7 +85,7 @@
  * @param	array	a key/value pair hidden data

  * @return	string

  */	

-if (! function_exists('form_open_multipart'))

+if ( ! function_exists('form_open_multipart'))

 {

 	function form_open_multipart($action, $attributes = array(), $hidden = array())

 	{

@@ -107,11 +107,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_hidden'))

+if ( ! function_exists('form_hidden'))

 {

 	function form_hidden($name, $value = '')

 	{

-		if (! is_array($name))

+		if ( ! is_array($name))

 		{

 			return '<input type="hidden" name="'.$name.'" value="'.form_prep($value).'" />';

 		}

@@ -137,11 +137,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_input'))

+if ( ! function_exists('form_input'))

 {

 	function form_input($data = '', $value = '', $extra = '')

 	{

-		$defaults = array('type' => 'text', 'name' => ((! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50');

+		$defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50');

 

 		return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";

 	}

@@ -160,11 +160,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_password'))

+if ( ! function_exists('form_password'))

 {

 	function form_password($data = '', $value = '', $extra = '')

 	{

-		if (! is_array($data))

+		if ( ! is_array($data))

 		{

 			$data = array('name' => $data);

 		}

@@ -187,11 +187,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_upload'))

+if ( ! function_exists('form_upload'))

 {

 	function form_upload($data = '', $value = '', $extra = '')

 	{

-		if (! is_array($data))

+		if ( ! is_array($data))

 		{

 			$data = array('name' => $data);

 		}

@@ -212,13 +212,13 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_textarea'))

+if ( ! function_exists('form_textarea'))

 {

 	function form_textarea($data = '', $value = '', $extra = '')

 	{

-		$defaults = array('name' => ((! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');

+		$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');

 	

-	    if (! is_array($data) OR ! isset($data['value']))

+	    if ( ! is_array($data) OR ! isset($data['value']))

 		{

 			$val = $value;

 		}

@@ -244,11 +244,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_dropdown'))

+if ( ! function_exists('form_dropdown'))

 {

 	function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')

 	{

-		if (! is_array($selected))

+		if ( ! is_array($selected))

 		{

 			$selected = array($selected);

 		}

@@ -287,11 +287,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_checkbox'))

+if ( ! function_exists('form_checkbox'))

 {

 	function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')

 	{

-		$defaults = array('type' => 'checkbox', 'name' => ((! is_array($data)) ? $data : ''), 'value' => $value);

+		$defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);

 	

 		if (is_array($data) AND array_key_exists('checked', $data))

 		{

@@ -328,11 +328,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_radio'))

+if ( ! function_exists('form_radio'))

 {

 	function form_radio($data = '', $value = '', $checked = FALSE, $extra = '')

 	{

-		if (! is_array($data))

+		if ( ! is_array($data))

 		{	

 			$data = array('name' => $data);

 		}

@@ -353,11 +353,11 @@
  * @param	string

  * @return	string

  */

-if (! function_exists('form_submit'))

+if ( ! function_exists('form_submit'))

 {	

 	function form_submit($data = '', $value = '', $extra = '')

 	{

-		$defaults = array('type' => 'submit', 'name' => ((! is_array($data)) ? $data : ''), 'value' => $value);

+		$defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);

 

 		return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";

 	}

@@ -374,11 +374,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_reset'))

+if ( ! function_exists('form_reset'))

 {

 	function form_reset($data = '', $value = '', $extra = '')

 	{

-		$defaults = array('type' => 'reset', 'name' => ((! is_array($data)) ? $data : ''), 'value' => $value);

+		$defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);

 

 		return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";

 	}

@@ -395,11 +395,11 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_button'))

+if ( ! function_exists('form_button'))

 {

 	function form_button($data = '', $content = '', $extra = '')

 	{

-		$defaults = array('name' => ((! is_array($data)) ? $data : ''), 'type' => 'submit');

+		$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit');

 		

 		if ( is_array($data) AND isset($data['content']))

 		{

@@ -422,7 +422,7 @@
  * @param	string	Additional attributes

  * @return	string

  */	

-if (! function_exists('form_label'))

+if ( ! function_exists('form_label'))

 {

 	function form_label($label_text = '', $id = '', $attributes = array())

 	{

@@ -460,7 +460,7 @@
  * @param	string	Additional attributes

  * @return	string

  */	

-if (! function_exists('form_fieldset'))

+if ( ! function_exists('form_fieldset'))

 {

 	function form_fieldset($legend_text = '', $attributes = array())

 	{

@@ -497,7 +497,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_fieldset_close'))

+if ( ! function_exists('form_fieldset_close'))

 {

 	function form_fieldset_close($extra = '')

 	{

@@ -514,7 +514,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_close'))

+if ( ! function_exists('form_close'))

 {

 	function form_close($extra = '')

 	{

@@ -533,7 +533,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('form_prep'))

+if ( ! function_exists('form_prep'))

 {

 	function form_prep($str = '')

 	{

@@ -574,7 +574,7 @@
  * @param	array

  * @return	string

  */	

-if (! function_exists('parse_form_attributes'))

+if ( ! function_exists('parse_form_attributes'))

 {

 	function parse_form_attributes($attributes, $default)

 	{

@@ -610,6 +610,6 @@
 	}

 }

 

-
-/* End of file form_helper.php */
+

+/* End of file form_helper.php */

 /* Location: ./system/helpers/form_helper.php */
\ No newline at end of file
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 592c33a..7a61055 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -38,7 +38,7 @@
  * @param	integer

  * @return	string

  */	

-if (! function_exists('heading'))

+if ( ! function_exists('heading'))

 {

 	function heading($data = '', $h = '1')

 	{

@@ -58,7 +58,7 @@
  * @param	mixed

  * @return	string

  */	

-if (! function_exists('ul'))

+if ( ! function_exists('ul'))

 {

 	function ul($list, $attributes = '')

 	{

@@ -78,7 +78,7 @@
  * @param	mixed

  * @return	string

  */	

-if (! function_exists('ol'))

+if ( ! function_exists('ol'))

 {

 	function ol($list, $attributes = '')

 	{

@@ -100,12 +100,12 @@
  * @param	intiger		

  * @return	string

  */	

-if (! function_exists('_list'))

+if ( ! function_exists('_list'))

 {

 	function _list($type = 'ul', $list, $attributes = '', $depth = 0)

 	{

 		// If an array wasn't submitted there's nothing to do...

-		if (! is_array($list))

+		if ( ! is_array($list))

 		{

 			return $list;

 		}

@@ -138,7 +138,7 @@
 			$out .= str_repeat(" ", $depth + 2);

 			$out .= "<li>";

 		

-			if (! is_array($val))

+			if ( ! is_array($val))

 			{

 				$out .= $val;

 			}

@@ -171,7 +171,7 @@
  * @param	integer

  * @return	string

  */	

-if (! function_exists('br'))

+if ( ! function_exists('br'))

 {

 	function br($num = 1)

 	{

@@ -190,11 +190,11 @@
  * @param	mixed

  * @return	string

  */	

-if (! function_exists('img'))

+if ( ! function_exists('img'))

 {

 	function img($src = '', $index_page = FALSE)

 	{

-		if (! is_array($src) )

+		if ( ! is_array($src) )

 		{

 			$src = array('src' => $src);

 		}

@@ -245,7 +245,7 @@
  * @param	boolean	should index_page be added to the css path 

  * @return	string

  */	

-if (! function_exists('link_tag'))

+if ( ! function_exists('link_tag'))

 {

 	function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)

 	{

@@ -320,7 +320,7 @@
  * @param	array

  * @return	string

  */	

-if (! function_exists('meta'))

+if ( ! function_exists('meta'))

 {

 	function meta($meta = array(), $newline = "\n")

 	{

@@ -343,7 +343,7 @@
  * @param	integer

  * @return	string

  */	

-if (! function_exists('nbs'))

+if ( ! function_exists('nbs'))

 {

 	function nbs($num = 1)

 	{

@@ -351,6 +351,6 @@
 	}

 }

 

-
-/* End of file html_helper.php */
+

+/* End of file html_helper.php */

 /* Location: ./system/helpers/html_helper.php */
\ No newline at end of file
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index b0b99be..49ba542 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -37,7 +37,7 @@
  * @param	string

  * @return	str

  */	

-if (! function_exists('singular'))

+if ( ! function_exists('singular'))

 {	

 	function singular($str)

 	{

@@ -78,7 +78,7 @@
  * @param	bool

  * @return	str

  */	

-if (! function_exists('plural'))

+if ( ! function_exists('plural'))

 {	

 	function plural($str, $force = FALSE)

 	{

@@ -116,7 +116,7 @@
  * @param	string

  * @return	str

  */	

-if (! function_exists('camelize'))

+if ( ! function_exists('camelize'))

 {	

 	function camelize($str)

 	{		

@@ -137,7 +137,7 @@
  * @param	string

  * @return	str

  */	

-if (! function_exists('underscore'))

+if ( ! function_exists('underscore'))

 {

 	function underscore($str)

 	{

@@ -156,7 +156,7 @@
  * @param	string

  * @return	str

  */	

-if (! function_exists('humanize'))

+if ( ! function_exists('humanize'))

 {	

 	function humanize($str)

 	{

@@ -164,6 +164,6 @@
 	}

 }

 	

-
-/* End of file inflector_helper.php */
+

+/* End of file inflector_helper.php */

 /* Location: ./system/helpers/inflector_helper.php */
\ No newline at end of file
diff --git a/system/helpers/path_helper.php b/system/helpers/path_helper.php
index 05bbd00..2810b29 100644
--- a/system/helpers/path_helper.php
+++ b/system/helpers/path_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -35,7 +35,7 @@
  * @param	bool	checks to see if the path exists

  * @return	string

  */	

-if (! function_exists('set_realpath'))

+if ( ! function_exists('set_realpath'))

 {

 	function set_realpath($path, $check_existance = TRUE)

 	{

@@ -57,7 +57,7 @@
 		// Make sure the path exists

 		if ($check_existance == TRUE)

 		{

-			if (! is_dir($path))

+			if ( ! is_dir($path))

 			{

 				show_error('Not a valid path: '.$path);

 			}

@@ -67,6 +67,6 @@
 	}

 }

 

-
-/* End of file path_helper.php */
+

+/* End of file path_helper.php */

 /* Location: ./system/helpers/path_helper.php */
\ No newline at end of file
diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php
index 0dc1429..8391c2d 100644
--- a/system/helpers/security_helper.php
+++ b/system/helpers/security_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -35,7 +35,7 @@
  * @param	string	the character set of your data

  * @return	string

  */	

-if (! function_exists('xss_clean'))

+if ( ! function_exists('xss_clean'))

 {

 	function xss_clean($str, $charset = 'ISO-8859-1')

 	{

@@ -53,15 +53,15 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('dohash'))

+if ( ! function_exists('dohash'))

 {	

 	function dohash($str, $type = 'sha1')

 	{

 		if ($type == 'sha1')

 		{

-			if (! function_exists('sha1'))

+			if ( ! function_exists('sha1'))

 			{

-				if (! function_exists('mhash'))

+				if ( ! function_exists('mhash'))

 				{	

 					require_once(BASEPATH.'libraries/Sha1'.EXT);

 					$SH = new CI_SHA;

@@ -93,7 +93,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('strip_image_tags'))

+if ( ! function_exists('strip_image_tags'))

 {

 	function strip_image_tags($str)

 	{

@@ -113,7 +113,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('encode_php_tags'))

+if ( ! function_exists('encode_php_tags'))

 {

 	function encode_php_tags($str)

 	{

@@ -121,6 +121,6 @@
 	}

 }

 

-
-/* End of file security_helper.php */
+

+/* End of file security_helper.php */

 /* Location: ./system/helpers/security_helper.php */
\ No newline at end of file
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 2162ddd..8f75437 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -37,7 +37,7 @@
  * @param	string	field name

  * @return	string

  */	

-if (! function_exists('js_insert_smiley'))

+if ( ! function_exists('js_insert_smiley'))

 {

 	function js_insert_smiley($form_name = '', $form_field = '')

 	{

@@ -63,11 +63,11 @@
  * @param	string	the URL to the folder containing the smiley images

  * @return	array

  */	

-if (! function_exists('get_clickable_smileys'))

+if ( ! function_exists('get_clickable_smileys'))

 {

 	function get_clickable_smileys($image_url = '', $smileys = NULL)

 	{

-		if (! is_array($smileys))

+		if ( ! is_array($smileys))

 		{

 			if (FALSE === ($smileys = _get_smiley_array()))

 			{

@@ -111,7 +111,7 @@
  * @param	string	the URL to the folder containing the smiley images

  * @return	string

  */	

-if (! function_exists('parse_smileys'))

+if ( ! function_exists('parse_smileys'))

 {

 	function parse_smileys($str = '', $image_url = '', $smileys = NULL)

 	{

@@ -120,7 +120,7 @@
 			return $str;

 		}

 

-		if (! is_array($smileys))

+		if ( ! is_array($smileys))

 		{

 			if (FALSE === ($smileys = _get_smiley_array()))

 			{

@@ -150,18 +150,18 @@
  * @access	private

  * @return	mixed

  */	

-if (! function_exists('_get_smiley_array'))

+if ( ! function_exists('_get_smiley_array'))

 {

 	function _get_smiley_array()

 	{

-		if (! file_exists(APPPATH.'config/smileys'.EXT))

+		if ( ! file_exists(APPPATH.'config/smileys'.EXT))

 		{

 			return FALSE;

 		}

 

 		include(APPPATH.'config/smileys'.EXT);

 	

-		if (! isset($smileys) OR ! is_array($smileys))

+		if ( ! isset($smileys) OR ! is_array($smileys))

 		{

 			return FALSE;

 		}

@@ -170,6 +170,6 @@
 	}

 }

 

-
-/* End of file smiley_helper.php */
+

+/* End of file smiley_helper.php */

 /* Location: ./system/helpers/smiley_helper.php */
\ No newline at end of file
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index b934723..7b6becf 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -42,7 +42,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('trim_slashes'))

+if ( ! function_exists('trim_slashes'))

 {

 	function trim_slashes($str)

 	{

@@ -61,7 +61,7 @@
  * @param	mixed	string or array

  * @return	mixed	string or array

  */	

-if (! function_exists('strip_slashes'))

+if ( ! function_exists('strip_slashes'))

 {

 	function strip_slashes($str)

 	{

@@ -92,7 +92,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('strip_quotes'))

+if ( ! function_exists('strip_quotes'))

 {

 	function strip_quotes($str)

 	{

@@ -111,7 +111,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('quotes_to_entities'))

+if ( ! function_exists('quotes_to_entities'))

 {

 	function quotes_to_entities($str)

 	{	

@@ -136,7 +136,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('reduce_double_slashes'))

+if ( ! function_exists('reduce_double_slashes'))

 {

 	function reduce_double_slashes($str)

 	{

@@ -163,7 +163,7 @@
  * @param	bool	TRUE/FALSE - whether to trim the character from the beginning/end

  * @return	string

  */	

-if (! function_exists('reduce_multiples'))

+if ( ! function_exists('reduce_multiples'))

 {

 	function reduce_multiples($str, $character = ',', $trim = FALSE)

 	{

@@ -190,7 +190,7 @@
  * @param	integer	number of characters

  * @return	string

  */

-if (! function_exists('random_string'))

+if ( ! function_exists('random_string'))

 {	

 	function random_string($type = 'alnum', $len = 8)

 	{					

@@ -234,7 +234,7 @@
  * @param	string (as many parameters as needed)

  * @return	string

  */	

-if (! function_exists('alternator'))

+if ( ! function_exists('alternator'))

 {

 	function alternator()

 	{

@@ -260,7 +260,7 @@
  * @param	integer	number of repeats

  * @return	string

  */	

-if (! function_exists('repeater'))

+if ( ! function_exists('repeater'))

 {

 	function repeater($data, $num = 1)

 	{

@@ -268,6 +268,6 @@
 	} 

 }

 

-
-/* End of file string_helper.php */
+

+/* End of file string_helper.php */

 /* Location: ./system/helpers/string_helper.php */
\ No newline at end of file
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 2d03699..18f33d2 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -38,7 +38,7 @@
  * @param	string	the end character. Usually an ellipsis

  * @return	string

  */	

-if (! function_exists('word_limiter'))

+if ( ! function_exists('word_limiter'))

 {

 	function word_limiter($str, $limit = 100, $end_char = '&#8230;')

 	{

@@ -72,7 +72,7 @@
  * @param	string	the end character. Usually an ellipsis

  * @return	string

  */	

-if (! function_exists('character_limiter'))

+if ( ! function_exists('character_limiter'))

 {

 	function character_limiter($str, $n = 500, $end_char = '&#8230;')

 	{

@@ -81,7 +81,7 @@
 			return $str;

 		}

 		

-		$str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str));

+		$str = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str));

 

 		if (strlen($str) <= $n)

 		{

@@ -111,7 +111,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('ascii_to_entities'))

+if ( ! function_exists('ascii_to_entities'))

 {

 	function ascii_to_entities($str)

 	{

@@ -163,7 +163,7 @@
  * @param	bool

  * @return	string

  */	

-if (! function_exists('entities_to_ascii'))

+if ( ! function_exists('entities_to_ascii'))

 {

 	function entities_to_ascii($str, $all = TRUE)

 	{

@@ -222,11 +222,11 @@
  * @param	string	the optional replacement value

  * @return	string

  */	

-if (! function_exists('word_censor'))

+if ( ! function_exists('word_censor'))

 {

 	function word_censor($str, $censored, $replacement = '')

 	{

-		if (! is_array($censored))

+		if ( ! is_array($censored))

 		{

 			return $str;

 		}

@@ -259,7 +259,7 @@
  * @param	string	the text string

  * @return	string

  */	

-if (! function_exists('highlight_code'))

+if ( ! function_exists('highlight_code'))

 {

 	function highlight_code($str)

 	{		

@@ -317,7 +317,7 @@
  * @param	string	the closing tag to end the phrase with

  * @return	string

  */	

-if (! function_exists('highlight_phrase'))

+if ( ! function_exists('highlight_phrase'))

 {

 	function highlight_phrase($str, $phrase, $tag_open = '<strong>', $tag_close = '</strong>')

 	{

@@ -349,19 +349,22 @@
  * @param	integer	the number of characters to wrap at

  * @return	string

  */	

-if (! function_exists('word_wrap'))

+if ( ! function_exists('word_wrap'))

 {

 	function word_wrap($str, $charlim = '76')

 	{

 		// Se the character limit

-		if (! is_numeric($charlim))

+		if ( ! is_numeric($charlim))

 			$charlim = 76;

 	

 		// Reduce multiple spaces

 		$str = preg_replace("| +|", " ", $str);

 	

 		// Standardize newlines

-		$str = preg_replace("/\r\n|\r/", "\n", $str);

+		if (strpos($str, "\r") !== FALSE)

+		{

+			$str = str_replace(array("\r\n", "\r"), "\n", $str);			

+		}

 	

 		// If the current word is surrounded by {unwrap} tags we'll 

 		// strip the entire chunk and replace it with a marker.

@@ -436,6 +439,6 @@
 	}

 }

 

-
-/* End of file text_helper.php */
+

+/* End of file text_helper.php */

 /* Location: ./system/helpers/text_helper.php */
\ No newline at end of file
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index 78ade5c..cfb2b94 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -34,7 +34,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('nl2br_except_pre'))

+if ( ! function_exists('nl2br_except_pre'))

 {

 	function nl2br_except_pre($str)

 	{

@@ -71,7 +71,7 @@
  * @param	string

  * @return	string

  */

-if (! function_exists('auto_typography'))

+if ( ! function_exists('auto_typography'))

 {

 	function auto_typography($str)

 	{

@@ -117,7 +117,10 @@
 		$str = ' '.$str.' ';

 		

 		// Standardize Newlines to make matching easier

-		$str = preg_replace("/(\r\n|\r)/", "\n", $str);

+		if (strpos($str, "\r") !== FALSE)

+		{

+			$str = str_replace(array("\r\n", "\r"), "\n", $str);			

+		}

 		

 		/*

 		 * Reduce line breaks

@@ -330,13 +333,13 @@
 			$one_before = substr($str, $start+$current-1, 1);

 			$one_after = substr($str, $start+$current+2, 1);

 			

-			if (! in_array($one_after, $space, TRUE) && $one_after != "<")

+			if ( ! in_array($one_after, $space, TRUE) && $one_after != "<")

 			{

 				$str = str_replace(	$one_before."\"'".$one_after,

 									$one_before."&#8220;&#8216;".$one_after,

 									$str);

 			}

-			elseif (! in_array($one_before, $space, TRUE) && (in_array($one_after, $space, TRUE) OR $one_after == '<'))

+			elseif ( ! in_array($one_before, $space, TRUE) && (in_array($one_after, $space, TRUE) OR $one_after == '<'))

 			{

 				$str = str_replace(	$one_before."\"'".$one_after,

 									$one_before."&#8221;&#8217;".$one_after,

@@ -363,7 +366,7 @@
 									$one_before."&#8216;&#8220;".$one_after,

 									$str);

 			}

-			elseif (! in_array($one_before, $space, TRUE) && $one_before != ">")

+			elseif ( ! in_array($one_before, $space, TRUE) && $one_before != ">")

 			{

 				$str = str_replace(	$one_before."'\"".$one_after,

 									$one_before."&#8217;&#8221;".$one_after,

@@ -378,7 +381,7 @@
 		{

 			for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i)

 			{

-				if (! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE))

+				if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE))

 				{

 					$str = str_replace(	$matches['0'][$i],

 										$matches['1'][$i]."&#8220;".$matches['2'][$i]."&#8221;".$matches['3'][$i],

@@ -391,7 +394,7 @@
 		{

 			for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i)

 			{

-				if (! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE))

+				if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE))

 				{

 					$str = str_replace(	$matches['0'][$i],

 										$matches['1'][$i]."&#8216;".$matches['2'][$i]."&#8217;".$matches['3'][$i],

@@ -412,7 +415,7 @@
 			$one_before = substr($str, $start+$current-1, 1);

 			$one_after = substr($str, $start+$current+1, 1);

 			

-			if (! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE))

+			if ( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE))

 			{

 				$str = str_replace(	$one_before."'".$one_after,

 									$one_before."&#8217;".$one_after,

@@ -435,9 +438,9 @@
 			$two_before = substr($str, $start+$current-2, 1);

 			$two_after = substr($str, $start+$current+3, 1);

 			

-			if ((! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE))

+			if (( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE))

 				OR

-				(! in_array($two_before, $space, TRUE) && ! in_array($two_after, $space, TRUE) && $one_before == ' ' && $one_after == ' ')

+				( ! in_array($two_before, $space, TRUE) && ! in_array($two_after, $space, TRUE) && $one_before == ' ' && $one_after == ' ')

 				)

 			{

 				$str = str_replace(	$two_before.$one_before."--".$one_after.$two_after,

@@ -468,13 +471,13 @@
 			$one_before = substr($str, $start+$current-1, 1);

 			$one_after = substr($str, $start+$current+1, 1);

 			

-			if (! in_array($one_after, $space, TRUE))

+			if ( ! in_array($one_after, $space, TRUE))

 			{

 				$str = str_replace(	$one_before.'"'.$one_after,

 									$one_before."&#8220;".$one_after,

 									$str);

 			}

-			elseif(! in_array($one_before, $space, TRUE))

+			elseif( ! in_array($one_before, $space, TRUE))

 			{

 				$str = str_replace(	$one_before."'".$one_after,

 									$one_before."&#8221;".$one_after,

@@ -495,13 +498,13 @@
 			$one_before = substr($str, $start+$current-1, 1);

 			$one_after = substr($str, $start+$current+1, 1);

 			

-			if (! in_array($one_after, $space, TRUE))

+			if ( ! in_array($one_after, $space, TRUE))

 			{

 				$str = str_replace(	$one_before."'".$one_after,

 									$one_before."&#8216;".$one_after,

 									$str);

 			}

-			elseif(! in_array($one_before, $space, TRUE))

+			elseif( ! in_array($one_before, $space, TRUE))

 			{

 				$str = str_replace(	$one_before."'".$one_after,

 									$one_before."&#8217;".$one_after,

@@ -542,6 +545,6 @@
 }

 

 

-
-/* End of file typography_helper.php */
+

+/* End of file typography_helper.php */

 /* Location: ./system/helpers/typography_helper.php */
\ No newline at end of file
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 32d2da8..16dd3e0 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -37,7 +37,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('site_url'))

+if ( ! function_exists('site_url'))

 {

 	function site_url($uri = '')

 	{

@@ -56,7 +56,7 @@
  * @access	public

  * @return	string

  */	

-if (! function_exists('base_url'))

+if ( ! function_exists('base_url'))

 {

 	function base_url()

 	{

@@ -75,7 +75,7 @@
  * @access	public

  * @return	string

  */	

-if (! function_exists('index_page'))

+if ( ! function_exists('index_page'))

 {

 	function index_page()

 	{

@@ -97,15 +97,15 @@
  * @param	mixed	any attributes

  * @return	string

  */	

-if (! function_exists('anchor'))

+if ( ! function_exists('anchor'))

 {

 	function anchor($uri = '', $title = '', $attributes = '')

 	{

 		$title = (string) $title;

 	

-		if (! is_array($uri))

+		if ( ! is_array($uri))

 		{

-			$site_url = (! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri;

+			$site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri;

 		}

 		else

 		{

@@ -140,13 +140,13 @@
  * @param	mixed	any attributes

  * @return	string

  */

-if (! function_exists('anchor_popup'))

+if ( ! function_exists('anchor_popup'))

 {

 	function anchor_popup($uri = '', $title = '', $attributes = FALSE)

 	{	

 		$title = (string) $title;

 	

-		$site_url = (! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri;

+		$site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri;

 	

 		if ($title == '')

 		{

@@ -158,14 +158,14 @@
 			return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank');\">".$title."</a>";

 		}

 	

-		if (! is_array($attributes))

+		if ( ! is_array($attributes))

 		{

 			$attributes = array();

 		}

 		

 		foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val)

 		{

-			$atts[$key] = (! isset($attributes[$key])) ? $val : $attributes[$key];

+			$atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key];

 		}

 

 		return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank', '"._parse_attributes($atts, TRUE)."');\">".$title."</a>";

@@ -183,7 +183,7 @@
  * @param	mixed 	any attributes

  * @return	string

  */

-if (! function_exists('mailto'))

+if ( ! function_exists('mailto'))

 {

 	function mailto($email, $title = '', $attributes = '')

 	{

@@ -213,7 +213,7 @@
  * @param	mixed 	any attributes

  * @return	string

  */

-if (! function_exists('safe_mailto'))

+if ( ! function_exists('safe_mailto'))

 {

 	function safe_mailto($email, $title = '', $attributes = '')

 	{

@@ -328,7 +328,7 @@
  * @param	bool 	whether to create pop-up links

  * @return	string

  */

-if (! function_exists('auto_link'))

+if ( ! function_exists('auto_link'))

 {

 	function auto_link($str, $type = 'both', $popup = FALSE)

 	{

@@ -393,7 +393,7 @@
  * @param	string	the URL

  * @return	string

  */

-if (! function_exists('prep_url'))

+if ( ! function_exists('prep_url'))

 {

 	function prep_url($str = '')

 	{

@@ -425,7 +425,7 @@
  * @param	string	the separator: dash, or underscore

  * @return	string

  */

-if (! function_exists('url_title'))

+if ( ! function_exists('url_title'))

 {

 	function url_title($str, $separator = 'dash')

 	{

@@ -474,7 +474,7 @@
  * @param	string	the method: location or redirect

  * @return	string

  */

-if (! function_exists('redirect'))

+if ( ! function_exists('redirect'))

 {

 	function redirect($uri = '', $method = 'location', $http_response_code = 302)

 	{

@@ -501,7 +501,7 @@
  * @param	bool

  * @return	string

  */

-if (! function_exists('_parse_attributes'))

+if ( ! function_exists('_parse_attributes'))

 {

 	function _parse_attributes($attributes, $javascript = FALSE)

 	{

@@ -532,6 +532,6 @@
 	}

 }

 

-
-/* End of file url_helper.php */
+

+/* End of file url_helper.php */

 /* Location: ./system/helpers/url_helper.php */
\ No newline at end of file
diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php
index b916644..256d1e0 100644
--- a/system/helpers/xml_helper.php
+++ b/system/helpers/xml_helper.php
@@ -1,4 +1,4 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 /**

  * CodeIgniter

  *

@@ -34,7 +34,7 @@
  * @param	string

  * @return	string

  */	

-if (! function_exists('xml_convert'))

+if ( ! function_exists('xml_convert'))

 {

 	function xml_convert($str)

 	{

@@ -57,6 +57,6 @@
 	}

 }

 

-
-/* End of file xml_helper.php */
+

+/* End of file xml_helper.php */

 /* Location: ./system/helpers/xml_helper.php */
\ No newline at end of file