Phan fixes with smarty class and file uploader class

This commit is contained in:
Clemens Schwaighofer
2020-01-22 15:48:34 +09:00
parent f7db84c62f
commit ce780b53c3
2 changed files with 27 additions and 24 deletions

View File

@@ -10,6 +10,7 @@ define('USE_DATABASE', true);
define('USE_HEADER', true); define('USE_HEADER', true);
require 'config.php'; require 'config.php';
require BASE.INCLUDES.'admin_header.php'; require BASE.INCLUDES.'admin_header.php';
if (is_object($smarty)) {
$smarty->MASTER_TEMPLATE_NAME = 'main_body.tpl'; $smarty->MASTER_TEMPLATE_NAME = 'main_body.tpl';
$smarty->TEMPLATE_NAME = 'smarty_test.tpl'; $smarty->TEMPLATE_NAME = 'smarty_test.tpl';
$smarty->CSS_SPECIAL_TEMPLATE_NAME = 'smart_test.css'; $smarty->CSS_SPECIAL_TEMPLATE_NAME = 'smart_test.css';
@@ -30,6 +31,7 @@ $smarty->setSmartyPaths();
// smarty test // smarty test
$smarty->DATA['SMARTY_TEST'] = 'Test Data'; $smarty->DATA['SMARTY_TEST'] = 'Test Data';
$smarty->DATA['TRANSLATE_TEST'] = $cms->l->__('Are we translated?'); $smarty->DATA['TRANSLATE_TEST'] = $cms->l->__('Are we translated?');
}
// drop down test with optgroups // drop down test with optgroups
$options = array ( $options = array (
@@ -48,8 +50,9 @@ $options = array (
) )
); );
if (is_object($smarty)) {
$smarty->DATA['drop_down_test'] = $options; $smarty->DATA['drop_down_test'] = $options;
// require BASE.INCLUDES.'admin_smarty.php'; // require BASE.INCLUDES.'admin_smarty.php';
$smarty->setSmartyVarsAdmin(); $smarty->setSmartyVarsAdmin();
}
require BASE.INCLUDES.'admin_footer.php'; require BASE.INCLUDES.'admin_footer.php';

View File

@@ -84,7 +84,7 @@ class qqFileUploader
$pathinfo = pathinfo($this->file->getName()); $pathinfo = pathinfo($this->file->getName());
$filename = $pathinfo['filename']; $filename = $pathinfo['filename'];
//$filename = md5(uniqid()); //$filename = md5(uniqid());
$ext = $pathinfo['extension']; $ext = $pathinfo['extension'] ?? '';
if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) { if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) {
$these = implode(', ', $this->allowedExtensions); $these = implode(', ', $this->allowedExtensions);