|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15032 Date_Calc::getMonthFullName() problem
Submitted: 2002-01-14 13:18 UTC Modified: 2002-01-14 14:03 UTC
From: matt at mohebbi dot com Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: matt at mohebbi dot com
New email:
PHP Version: OS:


 [2002-01-14 13:18 UTC] matt at mohebbi dot com
For the getMonthFullName function the specs state the input should be in the form MM. If call the function with 01 as its input it works fine. I believe php is automatically casting the number to an int and thus removing the 0. However, there are some cases where the function is called
with a variable as input (in my case a get variable) where this casting does not occur. The function then returns nothing. Below is a diff that fixes the getMonthFullName and GetMonthAbbrName for this case.

File bug.php:

require 'Date/Calc.php';
$en_month = Date_Calc::getMonthFullname($month);
echo "Test $en_month";

bug.php?month=01 output:

Before patch:

After patch:
Test January

>       // Cast month to an int to eliminate starting zero
>       $month = (int)$month;
>       $month = (int)$month;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-14 13:55 UTC]
Thanks, I commited your patch.

- Martin
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 23 17:01:23 2021 UTC