[wp-trac] [WordPress Trac] #28102: is_string check in validate_file

WordPress Trac noreply at wordpress.org
Fri May 2 20:30:58 UTC 2014


#28102: is_string check in validate_file
----------------------------------+------------------------------
 Reporter:  IwanLuijksQuestMedia  |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Plugins               |     Version:  3.9
 Severity:  normal                |  Resolution:
 Keywords:                        |     Focuses:  administration
----------------------------------+------------------------------

Comment (by juliobox):

 Hello

 So you're telling us that when you badly use a function, there is some PHP
 Warnings? Don't you say! :)
 This is not even a WordPress bug, because you can not reproduce it without
 a plugin/script badly written, am i wrong?

 The documentation is already there :

 {{{
  * @param string $file File path.
  * @param array $allowed_files List of allowed files.
  * @return int 0 means nothing is wrong, greater than 0 means something
 was wrong.
  */
 function validate_file( $file, $allowed_files = '' ) {
 }}}
 1st param is "string" as far as i can read.
 So, i don't think that each function have to check each type of the given
 parameters, just use it correctly, unless it works in a clean WP install.

 Thank you

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28102#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list