[wp-trac] [WordPress Trac] #28441: Errant activation hook with symlinked plugins in WordPress 3.9.x

WordPress Trac noreply at wordpress.org
Tue Jun 3 20:23:47 UTC 2014


#28441: Errant activation hook with symlinked plugins in WordPress 3.9.x
--------------------------+------------------------------
 Reporter:  clifgriffin   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.9.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by jdgrimes):

 This one does the same thing, in effect:

 {{{
 shopp -> /Users/me/Dropbox/Development/Repositories/shopp
 }}}

 FWIW, my test code adapted from `plugin_basename()`:

 {{{
 $file = '/Users/me/Dropbox/Development/Repositories/shopp-arrange/trunk
 /shopp-arrange.php';

 $wp_plugin_paths['/Applications/MAMP/htdocs_test/wp-
 content/plugins/shopp'] =
 '/Users/me/Dropbox/Development/Repositories/shopp';
 $wp_plugin_paths['/Applications/MAMP/htdocs_test/wp-
 content/plugins/trunk'] = '/Users/me/Dropbox/Development/Repositories
 /shopp-arrange/trunk';

 foreach ( $wp_plugin_paths as $dir => $realdir ) {
         if ( strpos( $file, $realdir ) === 0 ) {
                 $file = $dir . substr( $file, strlen( $realdir ) );
         }
 }

 $plugin_dir = '/Applications/MAMP/htdocs_test/wp-content/plugins';
 $mu_plugin_dir = 'doesntmatterwhat';
 $file = wp_normalize_path( $file );
 $plugin_dir = wp_normalize_path( $plugin_dir );

 $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' .
 preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path
 from plugins dir
 $file = trim($file, '/');
 echo $file;
 exit;
 }}}

 Result: `shopp-arrange/trunk/shopp-arrange.php`

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


More information about the wp-trac mailing list