Make WordPress Core

Changeset 42007


Ignore:
Timestamp:
10/24/2017 10:49:13 PM (7 years ago)
Author:
johnbillion
Message:

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

See #42016, #36170, #41017

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r41806 r42007  
    654654
    655655/**
    656  * Make sure that the file that was requested to edit, is allowed to be edited
    657  *
    658  * Function will die if you are not allowed to edit the file
     656 * Makes sure that the file that was requested to be edited is allowed to be edited.
     657 *
     658 * Function will die if you are not allowed to edit the file.
    659659 *
    660660 * @since 1.5.0
    661661 *
    662  * @param string $file file the users is attempting to edit
    663  * @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly
     662 * @param string $file          File the user is attempting to edit.
     663 * @param array  $allowed_files Optional. Array of allowed files to edit, $file must match an entry exactly.
    664664 * @return string|null
    665665 */
  • trunk/src/wp-includes/functions.php

    r41990 r42007  
    42394239
    42404240/**
    4241  * File validates against allowed set of defined rules.
    4242  *
    4243  * A return value of '1' means that the $file contains either '..' or './'. A
    4244  * return value of '2' means that the $file contains ':' after the first
    4245  * character. A return value of '3' means that the file is not in the allowed
    4246  * files list.
     4241 * Validates a file name and path against an allowed set of rules.
     4242 *
     4243 * A return value of `1` means the file path contains directory traversal.
     4244 *
     4245 * A return value of `2` means the file path contains a Windows drive path.
     4246 *
     4247 * A return value of `3` means the file is not in the allowed files list.
    42474248 *
    42484249 * @since 1.2.0
    42494250 *
    4250  * @param string $file File path.
    4251  * @param array  $allowed_files List of allowed files.
     4251 * @param string $file          File path.
     4252 * @param array  $allowed_files Optional. List of allowed files.
    42524253 * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
    42534254 */
Note: See TracChangeset for help on using the changeset viewer.