Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #37738, comment 2


Ignore:
Timestamp:
08/19/2016 09:30:31 PM (9 years ago)
Author:
deeptiboddapati
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37738, comment 2

    initial v1  
    11That ticket was really good to read. It helped me notice that the patch missed numeric strings such as '1' or '1.4'. In that ticket they used is_scalar but that returns true for 'apple' as well as '1'. I used is_numeric in this redone patch since it returns true for '1.36546' or '3' but not for '3rd' or 'apple'.
     2
     3
     4Additionally negative integers don't seem to be a problem. They return false because the ID field in wp_posts is unsigned and as a result there are no posts with negative IDs. The code handles it the same as it would if there were no post with that number.