ID: 15032
Updated by: yavo
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: PEAR related
Operating System: Linux
PHP Version: 4.0.6


Previous Comments:
------------------------------------------------------------------------

[2002-01-14 13:18:59] [EMAIL PROTECTED]

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:
Test

After patch:
Test January


1434c1434,1436
<
---
>
>       // Cast month to an int to eliminate starting zero
>       $month = (int)$month;
1457a1460
>       $month = (int)$month;

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=15032&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to