converted to unix-style eol
[www-register-wizard.git] / helpers / path_helper.php
index c5ee1fb..da5df98 100644 (file)
@@ -1,72 +1,72 @@
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');\r
-/**\r
- * CodeIgniter\r
- *\r
- * An open source application development framework for PHP 4.3.2 or newer\r
- *\r
- * @package            CodeIgniter\r
- * @author             ExpressionEngine Dev Team\r
- * @copyright  Copyright (c) 2008, EllisLab, Inc.\r
- * @license            http://codeigniter.com/user_guide/license.html\r
- * @link               http://codeigniter.com\r
- * @since              Version 1.0\r
- * @filesource\r
- */\r
-\r
-// ------------------------------------------------------------------------\r
-\r
-/**\r
- * CodeIgniter Path Helpers\r
- *\r
- * @package            CodeIgniter\r
- * @subpackage Helpers\r
- * @category   Helpers\r
- * @author             ExpressionEngine Dev Team\r
- * @link               http://codeigniter.com/user_guide/helpers/xml_helper.html\r
- */\r
-\r
-// ------------------------------------------------------------------------\r
-\r
-/**\r
- * Set Realpath\r
- *\r
- * @access     public\r
- * @param      string\r
- * @param      bool    checks to see if the path exists\r
- * @return     string\r
- */    \r
-if ( ! function_exists('set_realpath'))\r
-{\r
-       function set_realpath($path, $check_existance = FALSE)\r
-       {\r
-               // Security check to make sure the path is NOT a URL.  No remote file inclusion!\r
-               if (preg_match("#^(http:\/\/|https:\/\/|www\.|ftp|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#i", $path))\r
-               {\r
-                       show_error('The path you submitted must be a local server path, not a URL');\r
-               }\r
-       \r
-               // Resolve the path\r
-               if (function_exists('realpath') AND @realpath($path) !== FALSE)\r
-               {\r
-                       $path = realpath($path).'/';\r
-               }\r
-       \r
-               // Add a trailing slash\r
-               $path = preg_replace("#([^/])/*$#", "\\1/", $path);\r
-       \r
-               // Make sure the path exists\r
-               if ($check_existance == TRUE)\r
-               {\r
-                       if ( ! is_dir($path))\r
-                       {\r
-                               show_error('Not a valid path: '.$path);\r
-                       }\r
-               }\r
-       \r
-               return $path;\r
-       }\r
-}\r
-\r
-\r
-/* End of file path_helper.php */\r
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 4.3.2 or newer
+ *
+ * @package            CodeIgniter
+ * @author             ExpressionEngine Dev Team
+ * @copyright  Copyright (c) 2008, EllisLab, Inc.
+ * @license            http://codeigniter.com/user_guide/license.html
+ * @link               http://codeigniter.com
+ * @since              Version 1.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * CodeIgniter Path Helpers
+ *
+ * @package            CodeIgniter
+ * @subpackage Helpers
+ * @category   Helpers
+ * @author             ExpressionEngine Dev Team
+ * @link               http://codeigniter.com/user_guide/helpers/xml_helper.html
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * Set Realpath
+ *
+ * @access     public
+ * @param      string
+ * @param      bool    checks to see if the path exists
+ * @return     string
+ */    
+if ( ! function_exists('set_realpath'))
+{
+       function set_realpath($path, $check_existance = FALSE)
+       {
+               // Security check to make sure the path is NOT a URL.  No remote file inclusion!
+               if (preg_match("#^(http:\/\/|https:\/\/|www\.|ftp|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#i", $path))
+               {
+                       show_error('The path you submitted must be a local server path, not a URL');
+               }
+       
+               // Resolve the path
+               if (function_exists('realpath') AND @realpath($path) !== FALSE)
+               {
+                       $path = realpath($path).'/';
+               }
+       
+               // Add a trailing slash
+               $path = preg_replace("#([^/])/*$#", "\\1/", $path);
+       
+               // Make sure the path exists
+               if ($check_existance == TRUE)
+               {
+                       if ( ! is_dir($path))
+                       {
+                               show_error('Not a valid path: '.$path);
+                       }
+               }
+       
+               return $path;
+       }
+}
+
+
+/* End of file path_helper.php */
 /* Location: ./system/helpers/path_helper.php */
\ No newline at end of file