[wp-trac] [WordPress Trac] #34190: Function Reference/wp check filetype

WordPress Trac noreply at wordpress.org
Wed Oct 7 18:08:32 UTC 2015


#34190: Function Reference/wp check filetype
----------------------------+-----------------------
 Reporter:  lpkapil         |       Owner:
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:
Component:  Administration  |     Version:  4.3.1
 Severity:  critical        |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+-----------------------
Changes (by lpkapil):

 * status:  closed => reopened
 * resolution:  invalid =>
 * component:  Upload => Administration
 * severity:  normal => critical


Comment:

 Hi,

 let me know ? why it's not returning the file extension correctly as
 specified ?

 function debug(){
     var_dump(wp_check_filetype('/var/www/html/wordpress/wp-
 content/themes/twentyfifteen/user.class.php'));
     exit();
 }
 add_action('init', 'debug');

 I have checked with this code, as in codex :

 Parameters

 $filename
     (string) (required) File name or path.

         Default: None

 $mimes
     (array) (optional) Key is the file extension with value as the mime
 type.

         Default: null

 what's wrong here if i am supplying file name as "user.class.php" ?? why
 it returns bool false ? it should check the proper file extension and
 return that, if not it's useless for file that contains multiple dot in
 filename. share your views on same ?

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


More information about the wp-trac mailing list