From: Roan Kattouw Date: Thu, 17 Mar 2016 00:39:54 +0000 (-0700) Subject: Action::factory: Don't crash on missing Action classes X-Git-Tag: 1.31.0-rc.0~7592^2 X-Git-Url: http://git.cyclocoop.org/data/modifier.php?a=commitdiff_plain;h=9680bf8c8249e030320b2d0735d29b5f17e34de9;p=lhc%2Fweb%2Fwiklou.git Action::factory: Don't crash on missing Action classes Show the "no such action" error message instead. Normally I wouldn't favor putting this in here, but it's way too easy to register a missing class by accident, see my rant on T107921#2128080. Bug: T107921 Change-Id: I56da8a5810cae3547a0c8f2d3f435dfd790fbeaf --- diff --git a/includes/actions/Action.php b/includes/actions/Action.php index ead8efaebf..839d7b23e7 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -96,6 +96,9 @@ abstract class Action { $classOrCallable = self::getClass( $action, $page->getActionOverrides() ); if ( is_string( $classOrCallable ) ) { + if ( !class_exists( $classOrCallable ) ) { + return false; + } $obj = new $classOrCallable( $page, $context ); return $obj; }