Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#4166 closed defect (bug) (fixed)

Fix mktime() inside mysql2date() in wp-includes/functions.php

Reported by: josephscott's profile josephscott Owned by: rob1n's profile rob1n
Milestone: 2.2 Priority: low
Severity: minor Version: 2.2
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

All of the parameters to mktime() are supposed to be of type int. The problem is that substr() is being used to provide each parameter and it returns a string, not an int. This isn't fatal because PHP will do the conversion for you, but it does through a warning. The simple way to deal with this is to cast all of the substr() calls to int.

Attachments (1)

functions.php-dif (547 bytes) - added by josephscott 18 years ago.

Download all attachments as: .zip

Change History (4)

#1 @foolswisdom
18 years ago

  • Keywords has-patch added
  • Milestone changed from 2.4 to 2.2
  • Version set to 2.2

#2 @rob1n
18 years ago

  • Keywords commit added; mysql2date mktime removed
  • Owner changed from anonymous to rob1n

Looks good.

#3 @rob1n
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5284]) Cast substr()'s to int before passing through mktime() to prevent warning. Props josephscott. fixes #4166

Note: See TracTickets for help on using tickets.