[wp-trac] [WordPress Trac] #25924: Conflicting error messages in plugin editor

WordPress Trac noreply at wordpress.org
Tue Nov 12 11:24:23 UTC 2013


#25924: Conflicting error messages in plugin editor
----------------------------+-----------------------------
 Reporter:  MattyRob        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  trunk
 Severity:  minor           |   Keywords:  has-patch
----------------------------+-----------------------------
 I have recently been testing out the plugin editor in the administration
 menus. It seems to me that some of the error messages reported are
 conflicting when attempting to type in files names.

 For example, if you enter a file name with a ".." or  a "./" in the
 filenames path the error message reads as:

 {{{
 Sorry, can’t edit files with “..” in the name. If you are trying to edit a
 file in your WordPress home directory, you can just type the name of the
 file in.
 }}}

 So the "./" eventually is not correctly being reported back as an error,
 however this very error message indicates that files in the home directory
 can be edited. So, type in wp-config.php or .htaccess and another error
 appears:

 {{{
 No such file exists! Double check the name and try again.
 }}}

 The reason this error is reported is because the code is looking in the
 wrong places and in fact it seems that file in the home directory cannot
 be edited.

 A simple fix for this, presuming that the plugin editor is indeed only
 meant to allow editing of files in the wpc-ntent/plugins folder is to
 change the first error message to something like:
 {{{
 Sorry, can’t edit files with “..” or "./" in the name.
 }}}

 Note, this may affect the theme editor too, but I haven't looked at that.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25924>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list