Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Check array index, fix #87 #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/presenters/ProgramPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ public function actionCreate()
$model = $this->getModel();
$data = $this->getHttpRequest()->getPost();

$this->setBacklink($data['backlink']);
unset($data['backlink']);
if (isset($data['backlink'])) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about to also check if array key exists?

$this->setBacklink($data['backlink']);
unset($data['backlink']);
}

if(!array_key_exists('display_in_reg', $data)) {
$data['display_in_reg'] = 1;
Expand Down