Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#22429 closed enhancement (fixed)

Usage of @$_GET/@$_POST

Reported by: juliobox's profile juliobox Owned by: dd32's profile dd32
Milestone: 3.7 Priority: normal
Severity: trivial Version:
Component: Performance Keywords: has-patch commit
Focuses: Cc:

Description

Hello

I think we should use isset() in place of @ in front of 6 $_GET and $_POST in the following files:
/wp-admin/includes/ajax-actions.php
/wp-admin/includes/media.php
/wp-includes/theme.php


Example in ajax-actions.php:

<?php selected( @$_GET['m'], 0 ); ?>

becomes

<?php selected( isset( $_GET['m'] ) ? $_GET['m'] : 0, 0 ); ?>

@ is also bad at perf.

Attachments (1)

22429.diff (2.8 KB) - added by dd32 11 years ago.

Download all attachments as: .zip

Change History (5)

#2 @juliobox
12 years ago

Thanks Sergey, very good!

@dd32
11 years ago

#3 @dd32
11 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 3.7
  • Owner set to dd32
  • Status changed from new to accepted

Ok, these really don't need to be there..

#4 @dd32
11 years ago

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

In 25025:

Remove the usage of @$_GET and @$_POST and just check to see if the indicies are set. Fixes #22429

Note: See TracTickets for help on using tickets.