$this->security->get returns Undefined Index error

Bug #702600 reported by jsherk on 2011-01-13

This bug report was converted into a question: question #141403: $this->security->get returns Undefined Index error.

This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When I use $this->security->post['some_item'] and some_item is not set, it works fine (no error), but when you use $this->security->get['some_item'] and some_item is not set it gives you a warning/notice that says:
Undefined index: some_item

TitanKing (titan-phpdevshell) wrote :

This in general is standard PHP behavior. You need to check variables are set be fore using them. The empty() function works well for this.

if (! empty($this->security->get['some_item'])) {
    // Do something...

Changed in phpdevshell:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers