* @license GPLv2 http://files.syscp.org/misc/COPYING.txt * @package Functions * @version $Id: function.makeSecurePath.php 2724 2009-06-07 14:18:02Z flo $ */ /** * Function which returns a secure path, means to remove all multiple dots and slashes * * @param string The path * @return string The corrected path * @author Florian Lippert */ function makeSecurePath($path) { $search = Array( '#/+#', '#\.+#', '#\0+#' ); $replace = Array( '/', '.', '' ); $path = preg_replace($search, $replace, $path); return $path; }