johnbillion / extended-cpts

A library which provides extended functionality to WordPress custom post types and taxonomies.
GNU General Public License v2.0
980 stars 96 forks source link

Consider using a different method to check a date/time type value #190

Closed robert-h-at-cp closed 2 years ago

robert-h-at-cp commented 2 years ago

The code here uses the function strtotime() to determine whether the string value is a date/time-ish string. However, the strtotime() function is super liberal and, for example, sometime mistake a timestamp string for a valid date/time string but would parse it into a wrong date/time object. See more details here

Plz consider improving it by possibly using a different method.

johnbillion commented 2 years ago

Do you have an example of where this can get the date wrong? This handling was recently changed in version 5.0.0 in #187.

robert-h-at-cp commented 2 years ago

Oh. Thx! Didn't notice that it has already been patched. Will try the update. Closing the issue for now.