diff options
| author | Greg Roach <fisharebest@gmail.com> | 2014-09-18 16:07:18 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2014-09-18 16:07:18 +0100 |
| commit | d41520a343b581ec5e36379e39e1d04685053a99 (patch) | |
| tree | 1721d3e8a845a37bbfeb3b5c56d431fdbad786d1 /library | |
| parent | 638c61f00f33ca62228ad219b6660398f5abdafe (diff) | |
| download | webtrees-d41520a343b581ec5e36379e39e1d04685053a99.tar.gz webtrees-d41520a343b581ec5e36379e39e1d04685053a99.tar.bz2 webtrees-d41520a343b581ec5e36379e39e1d04685053a99.zip | |
Update vendor code: zend-framework and ext-calendar
Diffstat (limited to 'library')
13 files changed, 113 insertions, 81 deletions
diff --git a/library/autoload.php b/library/autoload.php index 827f91006d..771eec2dff 100644 --- a/library/autoload.php +++ b/library/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736::getLoader(); +return ComposerAutoloaderInitdc53286047dab341fdf097ef0c616c7d::getLoader(); diff --git a/library/bombayworks/zendframework1/library/Zend/Db/Adapter/Sqlsrv.php b/library/bombayworks/zendframework1/library/Zend/Db/Adapter/Sqlsrv.php index f2b7cdb4b5..836d3b04dd 100644 --- a/library/bombayworks/zendframework1/library/Zend/Db/Adapter/Sqlsrv.php +++ b/library/bombayworks/zendframework1/library/Zend/Db/Adapter/Sqlsrv.php @@ -314,6 +314,7 @@ class Zend_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Abstract return sprintf('%F', $value); } + $value = addcslashes($value, "\000\032"); return "'" . str_replace("'", "''", $value) . "'"; } diff --git a/library/bombayworks/zendframework1/library/Zend/File/Transfer/Adapter/Abstract.php b/library/bombayworks/zendframework1/library/Zend/File/Transfer/Adapter/Abstract.php index 1dd5273186..e7daa44b3a 100644 --- a/library/bombayworks/zendframework1/library/Zend/File/Transfer/Adapter/Abstract.php +++ b/library/bombayworks/zendframework1/library/Zend/File/Transfer/Adapter/Abstract.php @@ -555,6 +555,7 @@ abstract class Zend_File_Transfer_Adapter_Abstract * * @param array $options Options to set * @param array $files (Optional) Files to set the options for + * @return Zend_File_Transfer_Adapter_Abstract */ public function setOptions($options = array(), $files = null) { $file = $this->_getFiles($files, false, true); diff --git a/library/bombayworks/zendframework1/library/Zend/Ldap.php b/library/bombayworks/zendframework1/library/Zend/Ldap.php index 2eda505280..e95fd4fb14 100644 --- a/library/bombayworks/zendframework1/library/Zend/Ldap.php +++ b/library/bombayworks/zendframework1/library/Zend/Ldap.php @@ -814,6 +814,10 @@ class Zend_Ldap { $moreCreds = true; + // Security check: remove null bytes in password + // @see https://net.educause.edu/ir/library/pdf/csd4875.pdf + $password = str_replace("\0", '', $password); + if ($username === null) { $username = $this->_getUsername(); $password = $this->_getPassword(); diff --git a/library/bombayworks/zendframework1/library/Zend/Locale.php b/library/bombayworks/zendframework1/library/Zend/Locale.php index be883ac7e4..f8248323df 100644 --- a/library/bombayworks/zendframework1/library/Zend/Locale.php +++ b/library/bombayworks/zendframework1/library/Zend/Locale.php @@ -60,7 +60,7 @@ class Zend_Locale 'uz_UZ' => 'uz_Latn_UZ', 'vai_LR' => 'vai_Latn_LR', 'zh_CN' => 'zh_Hans_CN', - 'zh_HK' => 'zh_Hans_HK', + 'zh_HK' => 'zh_Hant_HK', 'zh_MO' => 'zh_Hans_MO', 'zh_SG' => 'zh_Hans_SG', 'zh_TW' => 'zh_Hant_TW', diff --git a/library/bombayworks/zendframework1/library/Zend/Validate/Abstract.php b/library/bombayworks/zendframework1/library/Zend/Validate/Abstract.php index c834aa27db..6159460551 100644 --- a/library/bombayworks/zendframework1/library/Zend/Validate/Abstract.php +++ b/library/bombayworks/zendframework1/library/Zend/Validate/Abstract.php @@ -264,7 +264,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface */ protected function _implodeRecursive(array $pieces) { - $values = ''; + $values = array(); foreach ($pieces as $item) { if (is_array($item)) { $values[] = $this->_implodeRecursive($item); diff --git a/library/bombayworks/zendframework1/library/Zend/Version.php b/library/bombayworks/zendframework1/library/Zend/Version.php index c1f4a0452d..f9a9636bf3 100644 --- a/library/bombayworks/zendframework1/library/Zend/Version.php +++ b/library/bombayworks/zendframework1/library/Zend/Version.php @@ -32,7 +32,7 @@ final class Zend_Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '1.12.8'; + const VERSION = '1.12.9'; /** * The latest stable version Zend Framework available diff --git a/library/composer/autoload_classmap.php b/library/composer/autoload_classmap.php index 879cd0b7d9..2eb14c7109 100644 --- a/library/composer/autoload_classmap.php +++ b/library/composer/autoload_classmap.php @@ -2419,10 +2419,10 @@ return array( 'Zend_Tag_Taggable' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Tag/Taggable.php', 'Zend_Test_DbAdapter' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/DbAdapter.php', 'Zend_Test_DbStatement' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/DbStatement.php', - 'Zend_Test_PHPUnit_Constraint_DomQuery' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/DomQuery41.php', + 'Zend_Test_PHPUnit_Constraint_DomQuery' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/DomQuery34.php', 'Zend_Test_PHPUnit_Constraint_Exception' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/Exception.php', 'Zend_Test_PHPUnit_Constraint_Redirect' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/Redirect34.php', - 'Zend_Test_PHPUnit_Constraint_ResponseHeader' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php', + 'Zend_Test_PHPUnit_Constraint_ResponseHeader' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php', 'Zend_Test_PHPUnit_ControllerTestCase' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/ControllerTestCase.php', 'Zend_Test_PHPUnit_DatabaseTestCase' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/DatabaseTestCase.php', 'Zend_Test_PHPUnit_Db_Connection' => $vendorDir . '/bombayworks/zendframework1/library/Zend/Test/PHPUnit/Db/Connection.php', diff --git a/library/composer/autoload_real.php b/library/composer/autoload_real.php index 62d26b9dc6..2f78fd1f4c 100644 --- a/library/composer/autoload_real.php +++ b/library/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736 +class ComposerAutoloaderInitdc53286047dab341fdf097ef0c616c7d { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitdc53286047dab341fdf097ef0c616c7d', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitdc53286047dab341fdf097ef0c616c7d', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); @@ -46,14 +46,14 @@ class ComposerAutoloaderInit5f0ef7dd08272c4d0e1d75086df9c736 $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire5f0ef7dd08272c4d0e1d75086df9c736($file); + composerRequiredc53286047dab341fdf097ef0c616c7d($file); } return $loader; } } -function composerRequire5f0ef7dd08272c4d0e1d75086df9c736($file) +function composerRequiredc53286047dab341fdf097ef0c616c7d($file) { require $file; } diff --git a/library/composer/installed.json b/library/composer/installed.json index 60ae033270..68099ded59 100644 --- a/library/composer/installed.json +++ b/library/composer/installed.json @@ -333,17 +333,17 @@ }, { "name": "bombayworks/zendframework1", - "version": "v1.12.8", - "version_normalized": "1.12.8.0", + "version": "v1.12.9", + "version_normalized": "1.12.9.0", "source": { "type": "git", "url": "https://github.com/bombayworks/zendframework1.git", - "reference": "98c442a8ea215f449548db9f2269944349acc786" + "reference": "4bce65c9427866dc62e9ea9ab511f0edffa49f85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bombayworks/zendframework1/zipball/98c442a8ea215f449548db9f2269944349acc786", - "reference": "98c442a8ea215f449548db9f2269944349acc786", + "url": "https://api.github.com/repos/bombayworks/zendframework1/zipball/4bce65c9427866dc62e9ea9ab511f0edffa49f85", + "reference": "4bce65c9427866dc62e9ea9ab511f0edffa49f85", "shasum": "" }, "require": { @@ -353,7 +353,7 @@ "phpunit/dbunit": "1.3.*", "phpunit/phpunit": "3.7.*" }, - "time": "2014-08-26 16:01:25", + "time": "2014-09-17 15:01:24", "bin": [ "bin/zf.sh", "bin/zf.php" @@ -386,17 +386,17 @@ }, { "name": "fisharebest/ext-calendar", - "version": "1.1.0", - "version_normalized": "1.1.0.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/fisharebest/ext-calendar.git", - "reference": "c7b8215eca18475112a7d1f1f351f15e054ae2f4" + "reference": "6ba593dd58de9964f456df0b388e77df1bce22a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fisharebest/ext-calendar/zipball/c7b8215eca18475112a7d1f1f351f15e054ae2f4", - "reference": "c7b8215eca18475112a7d1f1f351f15e054ae2f4", + "url": "https://api.github.com/repos/fisharebest/ext-calendar/zipball/6ba593dd58de9964f456df0b388e77df1bce22a1", + "reference": "6ba593dd58de9964f456df0b388e77df1bce22a1", "shasum": "" }, "require": { @@ -411,7 +411,7 @@ "suggest": { "patchwork/utf8": "ext/mb_string support is required to generate dates using Hebrew text." }, - "time": "2014-09-13 11:34:57", + "time": "2014-09-16 06:20:56", "type": "library", "installation-source": "dist", "autoload": { diff --git a/library/fisharebest/ext-calendar/CHANGELOG.md b/library/fisharebest/ext-calendar/CHANGELOG.md index 13a7d6d2b9..1827c8f821 100644 --- a/library/fisharebest/ext-calendar/CHANGELOG.md +++ b/library/fisharebest/ext-calendar/CHANGELOG.md @@ -1,6 +1,9 @@ CHANGE LOG ========== +## 1.1.2 (2014-09-16) + - Fix #1; add support for the third parameter in jdtojewish(). + ## 1.1.1 (2014-09-14) - Cannot inherit abstract classes in PHP 5.3.0 - 5.3.8. diff --git a/library/fisharebest/ext-calendar/src/JewishCalendar.php b/library/fisharebest/ext-calendar/src/JewishCalendar.php index 038188fcd0..adf8b2dc34 100644 --- a/library/fisharebest/ext-calendar/src/JewishCalendar.php +++ b/library/fisharebest/ext-calendar/src/JewishCalendar.php @@ -21,7 +21,7 @@ namespace Fisharebest\ExtCalendar; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -class JewishCalendar extends Calendar implements CalendarInterface{ +class JewishCalendar extends Calendar implements CalendarInterface { /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_NAME = 'Jewish'; @@ -56,13 +56,13 @@ class JewishCalendar extends Calendar implements CalendarInterface{ const ALAFIM = 'אלפים'; /** A year that is one day shorter than normal. */ - const DEFECTIVE_YEAR = -1; + const DEFECTIVE_YEAR = -1; /** A year that has the normal number of days. */ - const REGULAR_YEAR = 0; + const REGULAR_YEAR = 0; /** A year that is one day longer than normal. */ - const COMPLETE_YEAR = 1; + const COMPLETE_YEAR = 1; /** * Hebrew numbers are represented by letters, similar to roman numerals. @@ -70,15 +70,6 @@ class JewishCalendar extends Calendar implements CalendarInterface{ * @var string[] */ private static $HEBREW_NUMERALS = array( - 9000 => 'ט', - 8000 => 'ח', - 7000 => 'ז', - 6000 => 'ו', - 5000 => 'ה', - 4000 => 'ד', - 3000 => 'ג', - 2000 => 'ב', - 1000 => 'א', 400 => 'ת', 300 => 'ש', 200 => 'ר', @@ -109,23 +100,6 @@ class JewishCalendar extends Calendar implements CalendarInterface{ ); /** - * Some numerals take a different form when they appear at the end of a number. - * - * @var string[] - */ - private static $HEBREW_NUMERALS_FINAL = array( - 90 => 'צ', - 80 => 'פ', - 70 => 'ע', - 60 => 'ס', - 50 => 'נ', - 40 => 'מ', - 30 => 'ל', - 20 => 'כ', - 10 => 'י', - ); - - /** * These months have fixed lengths. Others are variable. * * @var int[] @@ -147,7 +121,7 @@ class JewishCalendar extends Calendar implements CalendarInterface{ -1 => array( // Deficient years 1 => 0, 30, 59, 88, 117, 147, 147, 176, 206, 235, 265, 294, 324 ), - 0 => array( // Regular years + 0 => array( // Regular years 1 => 0, 30, 59, 89, 118, 148, 148, 177, 207, 236, 266, 295, 325 ), 1 => array( // Complete years @@ -158,7 +132,7 @@ class JewishCalendar extends Calendar implements CalendarInterface{ -1 => array( // Deficient years 1 => 0, 30, 59, 88, 117, 147, 177, 206, 236, 265, 295, 324, 354 ), - 0 => array( // Regular years + 0 => array( // Regular years 1 => 0, 30, 59, 89, 118, 148, 178, 207, 237, 266, 296, 325, 355 ), 1 => array( // Complete years @@ -178,7 +152,8 @@ class JewishCalendar extends Calendar implements CalendarInterface{ /** * Determine whether a year is a leap year. * - * @param int $year + * @param int $year + * * @return bool */ public function leapYear($year) { @@ -441,24 +416,39 @@ class JewishCalendar extends Calendar implements CalendarInterface{ } /** + * Add geresh (׳) and gershayim (״) punctuation to numeric values. + * + * Gereshayim is a contraction of “geresh” and “gershayim”. + * + * @param string $number + * + * @return string + */ + protected function addGereshayim($hebrew) { + switch (mb_strlen($hebrew, 'UTF-8')) { + case 0: + // Zero, e.g. the zeros from the year 5,000 + return $hebrew; + case 1: + // Single digit - append a geresh + return $hebrew . self::GERESH; + default: + // Multiple digits - insert a gershayim + return mb_substr($hebrew, 0, mb_strlen($hebrew, 'UTF-8') - 1, 'UTF-8') . self::GERSHAYIM . mb_substr($hebrew, -1, 1, 'UTF-8'); + } + } + + /** * Convert a number into Hebrew numerals. - * - * @param int $number - * @param bool $alafim_garesh - * @param bool $alafim - * @param bool $gereshayim + * + * @param int $number + * @param bool $gereshayim Add punctuation to numeric values * * @return string */ - protected function numToHebrew($number, $alafim_garesh, $alafim, $gereshayim) { + protected function numberToHebrewNumerals($number, $gereshayim) { $hebrew = ''; while ($number > 0) { - foreach (self::$HEBREW_NUMERALS_FINAL as $n => $h) { - if ($number == $n) { - $hebrew .= $h; - break 2; - } - } foreach (self::$HEBREW_NUMERALS as $n => $h) { if ($number >= $n) { $hebrew .= $h; @@ -467,7 +457,38 @@ class JewishCalendar extends Calendar implements CalendarInterface{ } } } - return $hebrew; + + // Hebrew numerals are letters. Add punctuation to prevent confusion with actual words. + if ($gereshayim) { + return $this->addGereshayim($hebrew); + } else { + return $hebrew; + } + } + + /** + * Format a year using Hebrew numerals. + * + * @param int $year + * @param bool $alafim_geresh Add a geresh (׳) after thousands + * @param bool $alafim Add the word for thousands after the thousands + * @param bool $gereshayim Add geresh (׳) and gershayim (״) punctuation to numeric values + * + * @return string + */ + protected function yearToHebrewNumerals($year, $alafim_geresh, $alafim, $gereshayim) { + if ($year < 1000) { + return $this->numberToHebrewNumerals($year, $gereshayim); + } else { + $thousands = $this->numberToHebrewNumerals((int)($year / 1000), false); + if ($alafim_geresh) { + $thousands .= self::GERESH; + } + if ($alafim) { + $thousands .= ' ' . self::ALAFIM . ' '; + } + return $thousands . $this->numberToHebrewNumerals($year % 1000, $gereshayim); + } } /** @@ -484,8 +505,8 @@ class JewishCalendar extends Calendar implements CalendarInterface{ list($year, $month, $day) = $this->jdToYmd($jd); return - $this->numToHebrew($day, $alafim_garesh, $alafim, $gereshayim) . ' ' . + $this->numberToHebrewNumerals($day, $gereshayim) . ' ' . $this->hebrewMonthName($year, $month) . ' ' . - $this->numToHebrew($year, $alafim_garesh, $alafim, $gereshayim); + $this->yearToHebrewNumerals($year, $alafim_garesh, $alafim, $gereshayim); } } diff --git a/library/fisharebest/ext-calendar/src/Shim.php b/library/fisharebest/ext-calendar/src/Shim.php index ee7ce55bbb..fc6e468b15 100644 --- a/library/fisharebest/ext-calendar/src/Shim.php +++ b/library/fisharebest/ext-calendar/src/Shim.php @@ -220,18 +220,17 @@ class Shim { * * @return int */ - public static function easterDate($year=null) { - if ($year === null) { - $year = date('Y'); - } elseif ($year < 1970 || $year > 2037) { + public static function easterDate($year) { + if ($year < 1970 || $year > 2037) { return trigger_error('This function is only valid for years between 1970 and 2037 inclusive', E_USER_WARNING); } + $gregorian = new GregorianCalendar; $days = $gregorian->easterDays($year); - // Calculate time-zone offset - $date_time = new \DateTime('now', new \DateTimeZone(date_default_timezone_get())); - $offset_seconds = $date_time->format('Z'); + // Calculate time-zone offset + $date_time = new \DateTime('now', new \DateTimeZone(date_default_timezone_get())); + $offset_seconds = $date_time->format('Z'); if ($days < 11) { return jdtounix($gregorian->ymdToJd($year, 3, $days + 21)) - $offset_seconds; @@ -439,15 +438,18 @@ class Shim { * @link https://php.net/JdtoJewish * * @param int $juliandaycount A Julian Day number - * @param bool $hebrew If set, the date is returned in Hebrew text - * @param int $fl If set, then add alafim and gereshayim to the text + * @param bool $hebrew If true, the date is returned in Hebrew text + * @param int $fl If $hebrew is true, then add alafim and gereshayim to the text * * @return string A string of the form "month/day/year" */ - public static function jdToJewish($juliandaycount, $hebrew = false, $fl = 0) { + public static function jdToJewish($juliandaycount, $hebrew, $fl) { $jewish = new JewishCalendar; if ($hebrew) { + if ($juliandaycount < 347998 || $juliandaycount > 4000075) { + return trigger_error('Year out of range (0-9999).', E_USER_WARNING); + } $hebrew = $jewish->jdToHebrew($juliandaycount, $fl & CAL_JEWISH_ADD_ALAFIM_GERESH, $fl & CAL_JEWISH_ADD_ALAFIM, $fl & CAL_JEWISH_ADD_GERESHAYIM); // Our code generates Hebrew punctuation. PHP uses ASCII punctuation. $hebrew = strtr($hebrew, array(JewishCalendar::GERESH => "'", JewishCalendar::GERSHAYIM => '"')); |
