The check on lines 88 and 91 of node_expre.nodeapi.inc (7.x-1.8) incorrectly passes the node's "created" date as the second parameter to strtotime(). E.g., if the max expiration date is +1 year, and I create a node on July 15th, 2015, I'll never be able to set an expiration date past July 15th, 2016. The correct behavior is for the max expiration date to work against the current date instead of the node's create date. This can be accomplished by simply removing the second parameter to strtotime(), which causes to use the current system time.

CommentFileSizeAuthor
#2 max_expire_date-2549057-2.patch861 byteshawkeye.twolf

Comments

derek.deraps created an issue. See original summary.

hawkeye.twolf’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
StatusFileSize
new861 bytes

The attached patch removes the second parameter to strtotime() during the max node expire date check on node edit form submit. This changes the max node expire check to compare against the current date + max expire instead of node created date + max expire.

Nafes’s picture

Status: Active » Needs review

@derek, thank you. Let me test the patch.

  • Nafes committed e19ae1e on 7.x-1.x authored by derek.deraps
    Issue #2549057 by derek.deraps: Max expire date incorrectly uses "...

  • Nafes committed ed0b8e8 on 7.x-2.x authored by derek.deraps
    Issue #2549057 by derek.deraps: Max expire date incorrectly uses "...
Nafes’s picture

Status: Needs review » Fixed

Yes, "created" date parameter is incorrect here. Nice catch! Thank you @derek.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.