Development

#1434: patch1434

You must first sign up to be able to contribute.

Ticket #1434: patch1434

File patch1434, 1.2 kB (added by skr68, 2 years ago)
Line 
1 Index: lib/symfony/helper/DateHelper.php
2 ===================================================================
3 --- lib/symfony/helper/DateHelper.php   (Revision 3422)
4 +++ lib/symfony/helper/DateHelper.php   (Arbeitskopie)
5 @@ -36,7 +36,12 @@
6  function format_date($date, $format = 'd', $culture = null, $charset = null)
7  {
8    static $dateFormats = array();
9 -
10
11 +  if (is_null($date))
12 +  {
13 +   return null;
14 +  }
15
16    if (!$culture)
17    {
18      $culture = sfContext::getInstance()->getUser()->getCulture();
19 Index: lib/symfony/helper/NumberHelper.php
20 ===================================================================
21 --- lib/symfony/helper/NumberHelper.php (Revision 3422)
22 +++ lib/symfony/helper/NumberHelper.php (Arbeitskopie)
23 @@ -19,6 +19,11 @@
24  
25  function format_number($number, $culture = null)
26  {
27 +  if (is_null($number))
28 +  {
29 +   return null;
30 +  }
31 +   
32    $numberFormat = new sfNumberFormat(_current_language($culture));
33  
34    return $numberFormat->format($number);
35 @@ -26,6 +31,11 @@
36  
37  function format_currency($amount, $currency = null, $culture = null)
38  {
39 +  if (is_null($amount))
40 +  {
41 +   return null;
42 +  }
43 +   
44    $numberFormat = new sfNumberFormat(_current_language($culture));
45  
46    return $numberFormat->format($amount, 'c', $currency);