Opened 7 years ago

Closed 7 years ago

#2869 closed enhancement (fixed)

$_POST does not check on existing keys in sponsor info

Reported by: davidmosterd's profile davidmosterd Owned by: coreymckrill's profile coreymckrill
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch


The sponsor invoice info is submitted and only checked on a few nonce and single post field. In theory certain $_POST keys could not be present. Although this would only trigger a notice, it might be better to use PHP's native filter_input mechanism.

The function is save_post_sponsor in the WordCamp_Post_Types_Plugin class.

Attachments (2)

2869.meta.diff (1.5 KB) - added by davidmosterd 7 years ago.
Initial patch using filter_input
2869.meta.2.diff (1.9 KB) - added by davidmosterd 7 years ago.
code standards and small readable fix on variable name

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to WordCamp Site & Plugins

#2 @coreymckrill
7 years ago

  • Keywords good-first-bug added
  • Owner set to coreymckrill
  • Priority changed from lowest to low
  • Status changed from new to accepted

7 years ago

Initial patch using filter_input

7 years ago

code standards and small readable fix on variable name

#3 @davidmosterd
7 years ago

  • Keywords has-patch added; needs-patch removed

Could of course be applied to the entire class/ plugin, if we decide this is the right way to go I can go through the rest of the code as well.

#4 @coreymckrill
7 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 5568:

WordCamp Post Types: Avoid notices for missing $_POST keys

Use filter_input to ensure that $_POST keys exist before calling
their values. This function isn't used anywhere in Core because of
PHP compatibility issues, but it shouldn't cause an issue on

Props davidmosterd
Fixes #2869

Note: See TracTickets for help on using tickets.