mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 13:58:54 +00:00
[ticket/10586] Tidy up comments
PHPBB3-10586
This commit is contained in:
parent
6a0bad8c0b
commit
56f75dbf93
2 changed files with 2 additions and 8 deletions
|
@ -432,7 +432,7 @@ class phpbb_extension_manager
|
||||||
/**
|
/**
|
||||||
* Check to see if a given extension is available on the filesystem
|
* Check to see if a given extension is available on the filesystem
|
||||||
*
|
*
|
||||||
* @param string $name Extension name to check
|
* @param string $name Extension name to check NOTE: Can be user input
|
||||||
* @return bool Depending on whether or not the extension is available
|
* @return bool Depending on whether or not the extension is available
|
||||||
*/
|
*/
|
||||||
public function available($name)
|
public function available($name)
|
||||||
|
|
|
@ -24,14 +24,11 @@ $user->session_begin();
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
$user->setup('viewforum');
|
$user->setup('viewforum');
|
||||||
|
|
||||||
// If given an extension, look for a front controller
|
// Handle the display of extension front pages
|
||||||
if ($ext = $request->variable('ext', ''))
|
if ($ext = $request->variable('ext', ''))
|
||||||
{
|
{
|
||||||
// The class to load
|
|
||||||
$class = 'phpbb_ext_' . str_replace('/', '_', $ext) . '_controller';
|
$class = 'phpbb_ext_' . str_replace('/', '_', $ext) . '_controller';
|
||||||
|
|
||||||
// Make sure the specified extension is enabled
|
|
||||||
// and that it has a controller class
|
|
||||||
if (!$phpbb_extension_manager->available($ext))
|
if (!$phpbb_extension_manager->available($ext))
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
|
@ -48,17 +45,14 @@ if ($ext = $request->variable('ext', ''))
|
||||||
trigger_error($user->lang('EXTENSION_CONTROLLER_MISSING', $ext));
|
trigger_error($user->lang('EXTENSION_CONTROLLER_MISSING', $ext));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate the extension controller
|
|
||||||
$controller = new $class;
|
$controller = new $class;
|
||||||
|
|
||||||
// But let's make sure it's actually a proper controller
|
|
||||||
if (!($controller instanceof phpbb_extension_controller_interface))
|
if (!($controller instanceof phpbb_extension_controller_interface))
|
||||||
{
|
{
|
||||||
send_status_line(500, 'Internal Server Error');
|
send_status_line(500, 'Internal Server Error');
|
||||||
trigger_error($user->lang('EXTENSION_CLASS_WRONG_TYPE', $class));
|
trigger_error($user->lang('EXTENSION_CLASS_WRONG_TYPE', $class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's get it started...
|
|
||||||
$controller->handle();
|
$controller->handle();
|
||||||
exit_handler();
|
exit_handler();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue