From 4caccffdfe0dc2c82379a0892943f615f8ee291d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 1 Feb 2019 16:16:40 +0000 Subject: [PATCH] initialized $site with new stdClass() before assigning fields --- codepot/src/codepot/controllers/site.php | 2 ++ codepot/src/codepot/views/site_catalog.php | 1 + 2 files changed, 3 insertions(+) diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index 02a2cb5c..c5ec398a 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -227,6 +227,7 @@ class Site extends Controller // recompose the site information from POST data. unset ($site); + $site = new stdClass(); $site->id = $tmpid; $site->name = $this->input->post('site_name'); @@ -290,6 +291,7 @@ class Site extends Controller } else { + $site = new stdClass(); $site->id = $siteid; $site->name = ''; $site->summary = ''; diff --git a/codepot/src/codepot/views/site_catalog.php b/codepot/src/codepot/views/site_catalog.php index 3cc2e469..3f149ace 100644 --- a/codepot/src/codepot/views/site_catalog.php +++ b/codepot/src/codepot/views/site_catalog.php @@ -26,6 +26,7 @@ id = ''; $site->name = ''; $site->text = '';