Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295826

getCreatedTime returns string instead of integer

$
0
0

Problem/Motivation

The phpdocs of getCreatedTime mention that the timestamp will be returned as integer. While it is currently returning a string.
This leads to bugs when you do strict comparison with the changed time which is correctly returning an integer.

Steps to reproduce

if ($comment->getCreatedTime() !== $comment->getChangedTime()) {
  // Statement is always true
}

Proposed resolution

Convert the value to int, just like all other timestamp methods.


Viewing all articles
Browse latest Browse all 295826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>