Docs: Improve the docs for validate_file() and validate_file_to_edit().

See #42016, #36170, #41017

Built from https://develop.svn.wordpress.org/trunk@42007


git-svn-id: http://core.svn.wordpress.org/trunk@41841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2017-10-24 22:50:49 +00:00
parent 29d5ee851c
commit 4812370aab
3 changed files with 13 additions and 12 deletions

View File

@ -653,14 +653,14 @@ function wp_tempnam( $filename = '', $dir = '' ) {
} }
/** /**
* Make sure that the file that was requested to edit, is allowed to be edited * Makes sure that the file that was requested to be edited is allowed to be edited.
* *
* Function will die if you are not allowed to edit the file * Function will die if you are not allowed to edit the file.
* *
* @since 1.5.0 * @since 1.5.0
* *
* @param string $file file the users is attempting to edit * @param string $file File the user is attempting to edit.
* @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly * @param array $allowed_files Optional. Array of allowed files to edit, $file must match an entry exactly.
* @return string|null * @return string|null
*/ */
function validate_file_to_edit( $file, $allowed_files = '' ) { function validate_file_to_edit( $file, $allowed_files = '' ) {

View File

@ -4238,17 +4238,18 @@ function iis7_supports_permalinks() {
} }
/** /**
* File validates against allowed set of defined rules. * Validates a file name and path against an allowed set of rules.
* *
* A return value of '1' means that the $file contains either '..' or './'. A * A return value of `1` means the file path contains directory traversal.
* return value of '2' means that the $file contains ':' after the first *
* character. A return value of '3' means that the file is not in the allowed * A return value of `2` means the file path contains a Windows drive path.
* files list. *
* A return value of `3` means the file is not in the allowed files list.
* *
* @since 1.2.0 * @since 1.2.0
* *
* @param string $file File path. * @param string $file File path.
* @param array $allowed_files List of allowed files. * @param array $allowed_files Optional. List of allowed files.
* @return int 0 means nothing is wrong, greater than 0 means something was wrong. * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
*/ */
function validate_file( $file, $allowed_files = '' ) { function validate_file( $file, $allowed_files = '' ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-beta3-42006'; $wp_version = '4.9-beta3-42007';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.