Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#49980 closed defect (bug) (fixed)

lift error suppression flag from parse_url function calls

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


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 4 years ago.
includes all the function calls modified plus inserted PHP Doc statements

Download all attachments as: .zip

Change History (4)

4 years ago

includes all the function calls modified plus inserted PHP Doc statements

#1 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.5

#2 @SergeyBiryukov
4 years ago

  • Focuses coding-standards added

#3 @SergeyBiryukov
4 years 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.