Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11057 closed defect (bug) (fixed)

Notice: Undefined index: cat in canonical.php on line 128

Reported by: dd32 Owned by: westi
Priority: normal Milestone: 2.9
Component: Warnings/Notices Version: 2.9
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

By the look of it, Canonical seems to be accessing GET items without first checking if they exist, See attached patch

Attachments (1)

11057.diff (1.1 KB ) - added by dd32 17 years ago.

Download all attachments as: .zip

Change History (4)

@dd32
17 years ago

#1 @hakre
17 years ago

I just had only a quick look, maybe isset() needs to be used in case the get variable/index is not set?

#2 @dd32
17 years ago

Thats what empty() is being used for.

isset() And empty() do not issue the undefined warnings, Isset is good when you just want the index to be set, empty() is better when you want it to be set, and have a non-empty value.

#3 @ryan
17 years ago

  • Resolutionfixed
  • Status newclosed

(In [12202]) Fix undefined index notice in canonical. Props dd32. fixes #11057

Note: See TracTickets for help on using tickets.