WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#49980 closed defect (bug) (fixed)

lift error suppression flag from parse_url function calls

Reported by: netpassprodsr Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description

This issue deals with just one of the PHP functions referenced in #24780.
Props to @howdy_mcgee for recent work with related PHP error suppression lifting (#49889)

This issue focuses on occurrances of the parse_url() function.
Research indicates that PHP version 5.3.3 removed the E_WARNING from cases where the URL parsing failed.
Also, the latest WordPress release has 5.6.20 as the minimum required PHP version.
This eliminates the purpose for error suppression on these function calls as there will never be one.

I will attach a patch file for this ticket once the formal number has been assigned.

Attachments (1)

patch-49980.diff (11.1 KB) - added by netpassprodsr 6 months ago.
includes all the function calls modified plus inserted PHP Doc statements

Download all attachments as: .zip

Change History (4)

@netpassprodsr
6 months ago

includes all the function calls modified plus inserted PHP Doc statements

#1 @SergeyBiryukov
6 months ago

  • Milestone changed from Awaiting Review to 5.5

#2 @SergeyBiryukov
6 months ago

  • Focuses coding-standards added

#3 @SergeyBiryukov
6 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 47617:

Code Modernization: Remove error suppression from parse_url() calls.

Previously, the @ operator was used to prevent possible warnings emitted by parse_url() in PHP < 5.3.3 when URL parsing failed.

Now that the minimum version of PHP required by WordPress is 5.6.20, this is no longer needed.

Props netpassprodsr, Howdy_McGee.
Fixes #49980. See #24780.

Note: See TracTickets for help on using tickets.