Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 6 months ago

#63367 closed defect (bug) (fixed)

Remove unnecessary type casting in wp-links-opml.php

Reported by: dilipbheda's profile dilipbheda Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Feeds Keywords: has-patch
Focuses: coding-standards Cc:

Description

While reviewing the wp-links-opml.php file, I noticed that the $link_cat variable is being cast to (string). However, since the absint function already casts the value to (int), the explicit type casting to (string) seems unnecessary and can be removed.

Change History (4)

This ticket was mentioned in PR #8755 on WordPress/wordpress-develop by @dilipbheda.


8 months ago
#1

@umeshsinghin commented on PR #8755:


8 months ago
#2

absint() already casts to integer, so extra (string) is useless.
urldecode() is called only once — avoiding waste. (WordPress VIP coding standards and best practices)

Looks good to me

#3 @SergeyBiryukov
8 months ago

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

In 60207:

Coding Standards: Remove unnecessary type casting in wp-links-opml.php.

Follow-up to [13747].

Props dilipbheda, debarghyabanerjee, umeshsinghin.
Fixes #63367.

#4 @sabernhardt
6 months ago

  • Milestone changed from Awaiting Review to 6.9
Note: See TracTickets for help on using tickets.