diff options
| author | Jakub Zelenka <bukka@php.net> | 2016-06-19 16:20:02 +0100 |
|---|---|---|
| committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 16:20:02 +0100 |
| commit | c2b90805e81de43b4fa28fa1b30ed255bfba76b2 (patch) | |
| tree | a353bb7b1cb958fd4f3e576ab44f3b6ef03a02c2 /ext/intl/dateformat | |
| parent | b44cf1a8540d321583a0d83ebca688ebab10d3b0 (diff) | |
| parent | d0e84c6f4702dc5dda473851dd33c5e6cee82ee6 (diff) | |
| download | php-git-c2b90805e81de43b4fa28fa1b30ed255bfba76b2.tar.gz | |
Merge branch 'master' into openssl_error_store
Diffstat (limited to 'ext/intl/dateformat')
| -rw-r--r-- | ext/intl/dateformat/dateformat_format_object.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index 3be76332a8..e96ebe8243 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -146,7 +146,9 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) } //there's no support for relative time in ICU yet - timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative); + if (timeStyle != DateFormat::NONE) { + timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative); + } zend_class_entry *instance_ce = Z_OBJCE_P(object); if (instanceof_function(instance_ce, Calendar_ce_ptr)) { @@ -188,11 +190,11 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object) } if (pattern) { - df = new SimpleDateFormat( - UnicodeString(Z_STRVAL_P(format), Z_STRLEN_P(format), - UnicodeString::kInvariant), - Locale::createFromName(locale_str), - status); + StringPiece sp(Z_STRVAL_P(format)); + df = new SimpleDateFormat( + UnicodeString::fromUTF8(sp), + Locale::createFromName(locale_str), + status); if (U_FAILURE(status)) { intl_error_set(NULL, status, |
