From 9680bf8c8249e030320b2d0735d29b5f17e34de9 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 16 Mar 2016 17:39:54 -0700 Subject: [PATCH] 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 --- includes/actions/Action.php | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.20.1