2006-10-27 00:25:02 +00:00
|
|
|
<?php
|
|
|
|
// +-----------------------------------------------------------------------+
|
2011-01-18 00:02:52 +00:00
|
|
|
// | Piwigo - a PHP based photo gallery |
|
2008-04-04 22:57:23 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2016-01-14 12:17:58 +01:00
|
|
|
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
|
2008-04-04 22:57:23 +00:00
|
|
|
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
|
|
|
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | This program is free software; you can redistribute it and/or modify |
|
|
|
|
// | it under the terms of the GNU General Public License as published by |
|
|
|
|
// | the Free Software Foundation |
|
|
|
|
// | |
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
|
// | General Public License for more details. |
|
|
|
|
// | |
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
2006-10-27 00:25:02 +00:00
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
// | USA. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
if( !defined("PHPWG_ROOT_PATH") )
|
|
|
|
{
|
|
|
|
die ("Hacking attempt!");
|
|
|
|
}
|
|
|
|
|
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
|
|
|
check_status(ACCESS_ADMINISTRATOR);
|
|
|
|
|
2007-01-18 02:09:31 +00:00
|
|
|
$sections = explode('/', $_GET['section'] );
|
|
|
|
for ($i=0; $i<count($sections); $i++)
|
|
|
|
{
|
|
|
|
if (empty($sections[$i]) or $sections[$i]=='..')
|
|
|
|
{
|
|
|
|
unset($sections[$i]);
|
|
|
|
$i--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($sections)<2)
|
2006-10-27 00:25:02 +00:00
|
|
|
{
|
2007-01-09 11:38:54 +00:00
|
|
|
die('Invalid plugin URL');
|
2006-10-27 00:25:02 +00:00
|
|
|
}
|
2006-12-14 00:58:57 +00:00
|
|
|
|
2007-01-18 02:09:31 +00:00
|
|
|
$plugin_id = $sections[0];
|
2015-02-12 14:32:33 +00:00
|
|
|
|
2015-02-17 12:38:08 +00:00
|
|
|
if (!preg_match('/^[\w-]+$/', $plugin_id))
|
2015-02-12 14:32:33 +00:00
|
|
|
{
|
|
|
|
die('Invalid plugin identifier');
|
|
|
|
}
|
|
|
|
|
2007-02-28 03:07:12 +00:00
|
|
|
if ( !isset($pwg_loaded_plugins[$plugin_id]) )
|
2006-10-27 00:25:02 +00:00
|
|
|
{
|
2007-01-09 11:38:54 +00:00
|
|
|
die('Invalid URL - plugin '.$plugin_id.' not active');
|
2006-10-27 00:25:02 +00:00
|
|
|
}
|
|
|
|
|
2007-01-18 02:09:31 +00:00
|
|
|
$filename = PHPWG_PLUGINS_PATH.implode('/', $sections);
|
2007-01-09 11:38:54 +00:00
|
|
|
if (is_file($filename))
|
|
|
|
{
|
|
|
|
include_once($filename);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-01-18 02:09:31 +00:00
|
|
|
die('Missing file '.$filename);
|
2007-01-09 11:38:54 +00:00
|
|
|
}
|
|
|
|
?>
|