From 85d2a16ad66059b43165972175b573912963ee02 Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sat, 24 May 2014 11:28:00 +1000 Subject: [PATCH] Update Zend_Locale_Format to the latest Zend version --- thirdparty/Zend/Locale/Format.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/thirdparty/Zend/Locale/Format.php b/thirdparty/Zend/Locale/Format.php index bf711062b..c9ca57315 100644 --- a/thirdparty/Zend/Locale/Format.php +++ b/thirdparty/Zend/Locale/Format.php @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Locale * @subpackage Format - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Format.php 23775 2011-03-01 17:25:24Z ralph $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ require_once 'Zend/Locale/Data.php'; * @category Zend * @package Zend_Locale * @subpackage Format - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Format @@ -99,8 +99,9 @@ class Zend_Locale_Format $options['number_format'] = Zend_Locale_Data::getContent($locale, 'decimalnumber'); } else if ((gettype($value) !== 'string') and ($value !== NULL)) { require_once 'Zend/Locale/Exception.php'; + $stringValue = (string)(is_array($value) ? implode(' ', $value) : $value); throw new Zend_Locale_Exception("Unknown number format type '" . gettype($value) . "'. " - . "Format '$value' must be a valid number format string."); + . "Format '$stringValue' must be a valid number format string."); } break; @@ -113,8 +114,9 @@ class Zend_Locale_Format $options['date_format'] = Zend_Locale_Format::getDateFormat($locale); } else if ((gettype($value) !== 'string') and ($value !== NULL)) { require_once 'Zend/Locale/Exception.php'; + $stringValue = (string)(is_array($value) ? implode(' ', $value) : $value); throw new Zend_Locale_Exception("Unknown dateformat type '" . gettype($value) . "'. " - . "Format '$value' must be a valid ISO or PHP date format string."); + . "Format '$stringValue' must be a valid ISO or PHP date format string."); } else { if (((isset($options['format_type']) === true) and ($options['format_type'] == 'php')) or ((isset($options['format_type']) === false) and (self::$_options['format_type'] == 'php'))) { @@ -300,8 +302,8 @@ class Zend_Locale_Format // load class within method for speed require_once 'Zend/Locale/Math.php'; - $value = Zend_Locale_Math::normalize($value); $value = Zend_Locale_Math::floatalize($value); + $value = Zend_Locale_Math::normalize($value); $options = self::_checkOptions($options) + self::$_options; $options['locale'] = (string) $options['locale']; @@ -1137,7 +1139,7 @@ class Zend_Locale_Format if (empty($options['date_format'])) { $options['format_type'] = 'iso'; - $options['date_format'] = self::getDateFormat($options['locale']); + $options['date_format'] = self::getDateFormat(isset($options['locale']) ? $options['locale'] : null); } $options = self::_checkOptions($options) + self::$_options;