[wp-trac] [WordPress Trac] #28441: Errant activation hook with symlinked plugins in WordPress 3.9.x
WordPress Trac
noreply at wordpress.org
Sat Jan 24 14:38:52 UTC 2015
#28441: Errant activation hook with symlinked plugins in WordPress 3.9.x
--------------------------+------------------------------
Reporter: clifgriffin | Owner: rmccue
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 3.9
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Changes (by jdgrimes):
* keywords: => has-patch
Comment:
The solution is actually much simpler than I originally thought. I've
attached [attachment:28441.patch], which modifies `plugin_basename()` to
sort the paths with `arsort()` before resolving any symlinks. This sorts
the paths reverse-alphabetically while preserving the keys. This works
because it results in a longer path being listed before a shorter one with
the same base directory(ies). (If anyone knows of a better array sorting
function to use here, I'm all ears.)
I've included a unit test which demonstrates the fix.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28441#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list