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/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