/**
- * removes double slashes
+ * removes double slashes in path
* @param path
*/
function clean_slashes($path)
}
+/**
+ * makes sure path is valid
+ */
+function validate_path()
+{
+
+}
+
+
/**
* @param int $seconds Number of seconds to convert into a human-readable timestamp
* @return tring Human-readable approximate timestamp like "2 hours"
function get_url()
{
-$path_info = pathinfo($_SERVER['SCRIPT_URL']);
-$path_info['url'] = $_SERVER['SCRIPT_URL'];
+ $path_info = pathinfo($_SERVER['SCRIPT_URL']);
+ $path_info['url'] = preg_match("/\.\.\//", $_SERVER['SCRIPT_URL']) ? '/' : $_SERVER['SCRIPT_URL'];
return $path_info; //substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/'));
}