[wp-trac] [WordPress Trac] #13550: WP_PLUGIN_DIR doesn't detect symlinks

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 17 20:37:08 UTC 2010


#13550: WP_PLUGIN_DIR doesn't detect symlinks
---------------------------+------------------------------------------------
 Reporter:  acumensystems  |        Owner:  westi   
     Type:  enhancement    |       Status:  reopened
 Priority:  normal         |    Milestone:  3.1     
Component:  Plugins        |      Version:  3.0     
 Severity:  minor          |   Resolution:          
 Keywords:  has-patch      |  
---------------------------+------------------------------------------------

Comment(by vladimir_kolesnikov):

 Replying to [comment:13 westi]:
 > This won't work for plugins located elsewhere.

 Symbolic link is not an issue here. Technically the plugin is still
 accessible under /wp-content/plugins/<plugin_name>

 The problem with plugin_basename() was that when you are passing __FILE__
 as its argument, PHP passes the real path of the file, not the symlinked
 one.

 That is, if you have this:

 /wp-content/plugins/test.php is a symlink to /some/other/path/test.php

 __FILE__ in test.php will always be /some/other/path/test.php which breaks
 plugin_basename() because it expected to see /wp-content/plugins/test.php.
 However, since test.php is accessible from both locations,
 {{{plugins_url()}}} function still returns the correct result.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13550#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list