1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Stanislav Malyshev 3900ce97a3 fix argument type & remove warning 2013-10-20 23:04:38 -07:00
Gustavo Lopes befe4ab479 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed defective cloning in ext/intl classes
  NEWS for commit 72c807a
  Allow Spoofchecker to be registered on ICU 49.1
  Announce on NEWS change in 1ce572c
2012-08-26 23:42:57 +02:00
Gustavo Lopes 886a50a619 Fixed defective cloning in ext/intl classes
See also bug #62915
2012-08-26 23:42:13 +02:00
Gustavo Lopes b9eae3d67c Fix handling of several uinitialized intl objects
Master specific changes. Not having this in the merge commit helps
porting to pecl/intl
2012-08-22 22:54:43 +02:00
Gustavo Lopes fcd4420dbf Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix handling of several uinitialized intl objects
  Fix handling of several uinitialized intl objects
  - Fix NEWS
  - BFN

Conflicts:
	ext/intl/dateformat/dateformat.c
2012-08-22 22:53:07 +02:00
Gustavo Lopes 87803ace94 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix handling of several uinitialized intl objects
2012-08-22 22:37:52 +02:00
Gustavo Lopes a5d0c1e21b Fix handling of several uinitialized intl objects 2012-08-22 22:32:51 +02:00
Gustavo André dos Santos Lopes 06e06f026d Merge branch '5.4'
* 5.4:
  Fix test title and limit it to ICU >= 4.8
  Remove executable bit from files
  Limit test to ICU 49
  Remove executable bit from files
2012-07-30 11:04:48 +02:00
Gustavo André dos Santos Lopes dec7bad635 Merge branch '5.3' into 5.4
* 5.3:
  Limit test to ICU 49
  Remove executable bit from files
2012-07-30 10:31:10 +02:00
Gustavo André dos Santos Lopes 9762609cec Remove executable bit from files 2012-07-30 10:25:17 +02:00
Gustavo Lopes ae3a827bf9 Leak caused by wrong and unreachable cleanup 2012-07-23 17:00:52 +02:00
Gustavo Lopes c052b9c99a Do not fetch default locale once on minit or rinit
The default locale is now requested to ICU when it's needed by using
intl_get_default_locale().
2012-07-23 16:38:27 +02:00
Gustavo André dos Santos Lopes 99e48d3a57 Merge branch 'datefmt_tz_cal_interop'
* datefmt_tz_cal_interop:
  Readded accidentally removed line
  Added IntlDateFormatter::formatObject(). Refactor
  Refactored internal_get_timestamp()
  Unified zval -> UDate conversions
2012-07-22 04:22:48 +02:00
Gustavo André dos Santos Lopes 2498c90c71 Readded accidentally removed line 2012-07-22 04:22:23 +02:00
Gustavo André dos Santos Lopes 2f0775b999 Added IntlDateFormatter::formatObject(). Refactor
To better support IntlCalendar, added this function:

string IntlDateFormatter::formatObject(IntlCalendar|DateTime $obj [,
	array|int|string $format = null [, string $locale = null).

$format is either of the constants IntlDateFormatter::FULL, etc., in
which case this format applies to both the date and the time, an array
in the form array($dateFormat, $timeFormat), or a string with the
SimpleDateFormat pattern.

This uses both the Calendar type and the timezone of the passed object
to configure the formatter (a GregorianCalendar is forced for
DateTime).

Some stuff was moved around and slighlt modified to allow for more code
reuse.
2012-07-22 04:22:23 +02:00
Felipe Pena f94051ea11 - Fix conflict 2012-07-14 12:23:24 -03:00
Felipe Pena 0bff7cfadd - Fixed bug #62565 (Crashes due non-initialized internal properties_table) 2012-07-14 12:16:16 -03:00
Gustavo André dos Santos Lopes 46629e35ff Refactored internal_get_timestamp()
Added bounds checking for 32-bit ints.

Do not fetch array elements that ::parse() generates but that
::format() does not actually care about.y
2012-07-02 00:26:38 +02:00
Gustavo André dos Santos Lopes 2416719fb1 Unified zval -> UDate conversions
Now IntlDateFormatter::format() also accepts IntlCalendar objects.
Code is shared in MessageFormatter and IntlDateFormatter.
2012-07-02 00:24:54 +02:00
Gustavo André dos Santos Lopes eb346ef0f4 DateFormat plays nice with Calendar, TimeZone
The following changes were made:

* The IntlDateFormatter constructor now accepts the usual values
  for its $timezone argument. This includes timezone identifiers,
  IntlTimeZone objects, DateTimeZone objects and NULL. An empty
  string is not accepted. An invalid time zone is no longer accepted
  (it used to use UTC in this case).
* When NULL is passed to IntlDateFormatter, the time zone specified in
  date.timezone is used instead of the ICU default.
* The IntlDateFormatter $calendar argument now accepts also an
  IntlCalendar. In this case, IntlDateFormatter::getCalendar() will
  return false.
* The time zone passed to the IntlDateFormatter is ignored if it is
  NULL and if the calendar passed is an IntlCalendar object -- in this
  case, the IntlCalendar time zone will be used instead. Otherwise,
  the time zone specified in the $timezone argument is used instead.
* Added IntlDateFormatter::getCalendarObject(), which always returns
  the IntlCalendar object that backs the DateFormat, even if a
  constant was passed to the constructor, i.e., if an IntlCalendar
  was not passed to the constructor.
* Added IntlDateFormatter::setTimeZone(). It accepts the usual values
  for time zone arguments. If NULL is passed, the time zone of the
  IntlDateFormatter WILL be overridden with the default time zone,
  even if an IntlCalendar object was passed to the constructor.
* Added IntlDateFormatter::getTimeZone(), which returns the time zone
  that's associated with the DateFormat.
* Depreacated IntlDateFormatter::setTimeZoneId() and made it an alias
  for IntlDateFormatter::setTimeZone(), as the new ::setTimeZone()
  also accepts plain identifiers, besides other types.
  IntlDateFormatter::getTimeZoneId() is not deprecated however.
* IntlDateFormatter::setCalendar() with a constant passed should now
  work correctly. This requires saving the requested locale to the
  constructor.
* Centralized the hacks required to avoid compilation disasters on
  Windows due to some headers being included inside and outside of
  extern "C" blocks.
2012-06-04 00:01:48 +02:00
Gustavo André dos Santos Lopes e8009e2dca Merge branch '5.3' into 5.4 2012-05-24 11:08:55 +02:00
Gustavo André dos Santos Lopes 2da2de46a8 Fixed bug #60785
Memory leak in IntlDateFormatter constructor.

udat_setCalendar() clones the calendar before it adopts it,
so we were leaking the original calendar.

Also we now validate the calendar type.
2012-05-24 11:06:21 +02:00
Gustavo André dos Santos Lopes 0838a2b7c5 Merge branch '5.3' into 5.4 2012-05-23 15:52:32 +02:00
Gustavo André dos Santos Lopes e08566c613 Fixed bug #62017
IntlDateFormatter constructor would release some resources
under certain error conditions.
2012-05-23 15:52:19 +02:00
Gustavo André dos Santos Lopes 8ee8ccda19 Merge branch '5.3' into 5.4
Conflicts:
	sapi/fpm/fpm/fpm_main.c
2012-05-23 13:27:21 +02:00
Gustavo André dos Santos Lopes 07c0d714a5 Fixed bug #62081
Constructor of IntlDateFormatter would leak if called twice.

Made calling it more than once error out before starting
using resources.
2012-05-23 13:25:37 +02:00
Felipe Pena 13eb47a8bc - Added missing PHP_FE_END/ZEND_FE_END 2011-08-06 01:22:27 +00:00
Felipe Pena 783b05326a - Added missing PHP_FE_END/ZEND_FE_END 2011-08-06 01:22:27 +00:00
Felipe Pena 8b27b6d559 - Fixed possible efree(NULL) (bug #55296) 2011-08-04 00:59:43 +00:00
Felipe Pena d8f08192ef - Fixed possible efree(NULL) (bug #55296) 2011-08-04 00:59:43 +00:00
Stanislav Malyshev 7d3a0e15f5 Imlement clone for formatters that support it
# also some test fixes, more to follow
2011-01-03 03:58:57 +00:00
Stanislav Malyshev 28584c233e Imlement clone for formatters that support it
# also some test fixes, more to follow
2011-01-03 03:58:57 +00:00
Gustavo André dos Santos Lopes 9ec9210fbc - Fixed bug #53612 (Segmentation fault when using several cloned intl
objects).
2010-12-27 01:10:08 +00:00
Gustavo André dos Santos Lopes 610bb96036 - Fixed bug #53612 (Segmentation fault when using several cloned intl
objects).
2010-12-27 01:10:08 +00:00
Felipe Pena f327f13204 - Fixed ZTS build 2010-11-21 17:41:33 +00:00
Felipe Pena 167e51f36c - Fixed ZTS build 2010-11-21 17:41:33 +00:00
Stanislav Malyshev 0ba1cd1bd2 Add support for DateTime in datefmt_format 2010-11-20 02:09:04 +00:00
Stanislav Malyshev 4415b3af51 Add support for DateTime in datefmt_format 2010-11-20 02:09:04 +00:00
Stanislav Malyshev 0fa76d2407 Fix invalid args bugs by Maksymilian Arciemowicz 2010-11-19 23:22:55 +00:00
Stanislav Malyshev e6c213b8ea Fix invalid args bugs by Maksymilian Arciemowicz 2010-11-19 23:22:55 +00:00
Stanislav Malyshev a54ac71371 Fix bug #50590 - IntlDateFormatter::parse result is limited to the integer range 2010-09-01 20:34:59 +00:00
Stanislav Malyshev 68eb876351 Fix bug #50590 - IntlDateFormatter::parse result is limited to the integer range 2010-09-01 20:34:59 +00:00
Johannes Schlüter 26b08f9857 Remove main/php3_compat.h, for that a few references to function_entry have
to be replaced by `zend_function_entry`.
2010-03-30 23:03:02 +00:00
Stanislav Malyshev 882a89fb22 cleanup some code, improve error handling 2009-12-23 21:41:05 +00:00
Felipe Pena fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Felipe Pena 7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Felipe Pena df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Stanislav Malyshev d8c0c2203b fix formatting/parsing 2008-09-04 00:15:25 +00:00
Stanislav Malyshev 95d9565902 ws cleanup 2008-09-04 00:08:17 +00:00
Felipe Pena eb1837d9de MFH:
- Added arginfo
- Fixed WS
- Changed C++ comments to C comments
2008-08-11 19:48:00 +00:00