[wp-trac] [WordPress Trac] #63445: Replace value casting with ! empty() check for positive value validation

WordPress Trac noreply at wordpress.org
Wed May 14 13:42:16 UTC 2025


#63445: Replace value casting with ! empty() check for positive value validation
-----------------------------------------+-------------------------------
 Reporter:  dilipbheda                   |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  closed
 Priority:  normal                       |   Milestone:
Component:  Comments                     |     Version:
 Severity:  normal                       |  Resolution:  wontfix
 Keywords:  has-patch changes-requested  |     Focuses:  coding-standards
-----------------------------------------+-------------------------------

Comment (by SirLouen):

 Replying to [comment:8 siliconforks]:
 > Note that these are not equivalent to the original code in handling
 invalid input.

 True, [https://3v4l.org/r5JlV I've tested] and you are right in this
 regard
 Don't ask me why but I was trusting that this was actually a PHPCS error
 (something like a usage of a non-sanitized variable or something like
 that) that needed to be addressed. But now I'm checking, and this is not a
 PHPCS trouble or whatsoever…

 @dilipbheda, out of curiosity, what were you looking when you got to this
 idea to try to fix the code?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63445#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list