Skip to content

Commit

Permalink
Fix a regression with controllers for specific formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Nov 21, 2011
1 parent a3a9975 commit dd7c846
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libraries/joomla/application/component/controller.php
Expand Up @@ -270,8 +270,10 @@ public static function getInstance($prefix, $config = array())
$task = $command;

// Define the controller filename and path.
$file = self::createFileName('controller', array('name' => 'controller', 'format' => $format));
$path = $basePath . '/' . $file;
$file = self::createFileName('controller', array('name' => 'controller', 'format' => $format));
$path = $basePath . '/' . $file;
$backupfile = self::createFileName('controller', array('name' => 'controller'));
$backuppath = $basePath . '/' . $backupfile;
}

// Get the controller class name.
Expand All @@ -285,6 +287,10 @@ public static function getInstance($prefix, $config = array())
{
require_once $path;
}
elseif (isset($backuppath) && file_exists($backuppath))
{
require_once $backuppath;
}
else
{
throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format));
Expand Down

0 comments on commit dd7c846

Please sign in to comment.