Add some page template validation

git-svn-id: http://svn.automattic.com/wordpress/trunk@7921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-05-12 23:51:54 +00:00
parent 9830ab988c
commit dcf35ab2ed
3 changed files with 17 additions and 17 deletions

View File

@@ -68,22 +68,6 @@ function wp_tempnam($filename = '', $dir = ''){
return $filename;
}
function validate_file( $file, $allowed_files = '' ) {
if ( false !== strpos( $file, '..' ))
return 1;
if ( false !== strpos( $file, './' ))
return 1;
if (':' == substr( $file, 1, 1 ))
return 2;
if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )
return 3;
return 0;
}
function validate_file_to_edit( $file, $allowed_files = '' ) {
$file = stripslashes( $file );