mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 17:44:38 +09:00
Fix #1635 uninitialized variables in procLayoutAdminCopyLayout()
This commit is contained in:
parent
d0916abf7f
commit
6a568e8e79
1 changed files with 20 additions and 7 deletions
|
|
@ -695,12 +695,23 @@ class layoutAdminController extends layout
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->extra_vars = $output->extra_vars;
|
$args->extra_vars = $output->extra_vars;
|
||||||
$extra_vars = unserialize($args->extra_vars);
|
$extra_vars = unserialize($args->extra_vars);
|
||||||
|
$image_list = array();
|
||||||
|
|
||||||
if($layout->extra_var_count) {
|
if($layout->extra_var_count && $extra_vars)
|
||||||
|
{
|
||||||
$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
|
$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
|
||||||
if($extra_vars) foreach($extra_vars as $key => $val) {
|
foreach($extra_vars as $key => $val)
|
||||||
if($layout->extra_var->{$key}->type == 'image') {
|
{
|
||||||
if(!preg_match($reg,$val,$matches)) continue;
|
if($layout->extra_var->{$key}->type == 'image')
|
||||||
|
{
|
||||||
|
if(!preg_match($reg, $val, $matches))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(!isset($image_list[$key]))
|
||||||
|
{
|
||||||
|
$image_list[$key] = new stdClass;
|
||||||
|
}
|
||||||
$image_list[$key]->filename = $matches[2];
|
$image_list[$key]->filename = $matches[2];
|
||||||
$image_list[$key]->old_file = $val;
|
$image_list[$key]->old_file = $val;
|
||||||
}
|
}
|
||||||
|
|
@ -732,9 +743,11 @@ class layoutAdminController extends layout
|
||||||
$args->layout_srl = getNextSequence();
|
$args->layout_srl = getNextSequence();
|
||||||
$args->title = $value;
|
$args->title = $value;
|
||||||
|
|
||||||
if(is_array($image_list)) {
|
if($image_list)
|
||||||
foreach($image_list as $key=>$val) {
|
{
|
||||||
$new_file = sprintf("./files/attach/images/%d/%s", $args->layout_srl,$val->filename);
|
foreach($image_list as $key => $val)
|
||||||
|
{
|
||||||
|
$new_file = sprintf("./files/attach/images/%d/%s", $args->layout_srl, $val->filename);
|
||||||
FileHandler::copyFile($val->old_file, $new_file);
|
FileHandler::copyFile($val->old_file, $new_file);
|
||||||
$extra_vars->{$key} = $new_file;
|
$extra_vars->{$key} = $new_file;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue