Permalink
Browse files

[fix] findmanifest should prioritize main folder manifests

  • Loading branch information...
1 parent 5fbac7b commit 2bbbc575b2b8bf125ec8002de8f14eb8ef2497f0 @phproberto phproberto committed Mar 4, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 libraries/legacy/installer/installer.php
@@ -1836,8 +1836,14 @@ public function copyManifest($cid = 1)
*/
public function findManifest()
{
- // Get an array of all the XML files from the installation directory
- $xmlfiles = JFolder::files($this->getPath('source'), '.xml$', 1, true);
+ // Main folder manifests (higher priority)
+ $parentXmlfiles = JFolder::files($this->getPath('source'), '.xml$', false, true);
+
+ // Search for children manifests (lower priority)
+ $allXmlFiles = JFolder::files($this->getPath('source'), '.xml$', 1, true);
+
+ // Create an unique array of files ordered by priority
+ $xmlfiles = array_unique(array_merge($parentXmlfiles, $allXmlFiles));
// If at least one XML file exists
if (!empty($xmlfiles))

0 comments on commit 2bbbc57

Please sign in to comment.