[BUGFIX] EM: Handle missing dependencies in emconf 47/29947/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 8 May 2014 16:48:11 +0000 (18:48 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 29 May 2014 11:26:34 +0000 (13:26 +0200)
ext_emconf.php may lack the dependencies array. This will cause
a PHP warning in a foreach loop.

Fix this by checking for the type first.

Resolves: #58640
Releases: 6.2
Change-Id: Ifb04268e04f5349282f895f6b3d7354dbc45affc
Reviewed-on: https://review.typo3.org/29947
Reviewed-by: Christian Kuhn
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extensionmanager/Classes/Utility/ExtensionModelUtility.php

index 341a195..72ce4be 100644 (file)
@@ -66,8 +66,11 @@ class ExtensionModelUtility {
         * @return \SplObjectStorage
         */
        public function convertDependenciesToObjects($dependencies) {
-               $unserializedDependencies = unserialize($dependencies);
                $dependenciesObject = new \SplObjectStorage();
+               $unserializedDependencies = unserialize($dependencies);
+               if (!is_array($unserializedDependencies)) {
+                       return $dependenciesObject;
+               }
                foreach ($unserializedDependencies as $dependencyType => $dependencyValues) {
                        // Dependencies might be given as empty string, e.g. conflicts => ''
                        if (!is_array($dependencyValues)) {