[BUGFIX] Remove PHP warnings in request
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Request.php
index 35e4f5d..3008645 100644 (file)
@@ -356,10 +356,13 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
                $controllerObjectName = $this->getControllerObjectName();
                if ($controllerObjectName !== '' && $this->controllerActionName === strtolower($this->controllerActionName)) {
                        $actionMethodName = $this->controllerActionName . 'Action';
-                       foreach (get_class_methods($controllerObjectName) as $existingMethodName) {
-                               if (strtolower($existingMethodName) === strtolower($actionMethodName)) {
-                                       $this->controllerActionName = substr($existingMethodName, 0, -6);
-                                       break;
+                       $classMethods = get_class_methods($controllerObjectName);
+                       if (is_array($classMethods)) {
+                               foreach ($classMethods as $existingMethodName) {
+                                       if (strtolower($existingMethodName) === strtolower($actionMethodName)) {
+                                               $this->controllerActionName = substr($existingMethodName, 0, -6);
+                                               break;
+                                       }
                                }
                        }
                }