This is one followup of
MDL-33080, that was applied as a quick fix for some common IMS-CC packages (manifest on root, with other manifests - imscp, scorm... in other dirs).
From the original issue, Darko:
What you did is correct and it can serve as patch for now but it does not really guarantee fulproof solution. We may have a case with 3 levels of directories where manifest file is on the third level, but there are also other manifests from some scorm content. And than the subdirectory where imsmanifest.xml from scorm has a name which is named in such way to appear earlier in scan than the real manifest and it will bomb again.
The real solution would be to search for all instances of imsmanifest.xml and take one that works. Only in case where there is no imamanifest.xml at all or the existing instances are not common cartridge compliant than bomb.
So the idea is to improve the imsmanifest.xml detection, looking for an IMS-CC one properly, ignoring others.