Skip to content

Commit

Permalink
Emulate PHP bug 54254 in Hebrew dates
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Sep 11, 2014
1 parent 3c038bc commit 63cd5df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@ CHANGE LOG

## 1.0.2 (2014-09-11)
- Wrong encoding of Hebrew dates
- Emulate PHP bug 54254 in Hebrew dates

## 1.0.1 (2014-09-11)
- Improve coverage of unit tests.
Expand Down
4 changes: 2 additions & 2 deletions src/JewishCalendar.php
Expand Up @@ -416,8 +416,8 @@ protected function hebrewMonthNames($year) {

return array(
1 => 'תשרי', 'חשון', 'כסלו', 'טבת', 'שבט',
$leap_year ? 'אדר א׳' : '',
$leap_year ? 'אדר ב׳' : 'אדר',
$leap_year ? (Shim::emulateBug54254() ? 'אדר' : 'אדר א׳') : 'אדר',
$leap_year ? (Shim::emulateBug54254() ? '\'אדר ב' : 'אדר ב׳') : 'אדר',
'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול',
);
}
Expand Down
2 changes: 0 additions & 2 deletions test/JewishCalendarTest.php
Expand Up @@ -234,10 +234,8 @@ public function testJdToHebrew() {
foreach (array(0, CAL_JEWISH_ADD_ALAFIM_GERESH) as $alafim_geresh) {
$ours = $jewish->jdToHebrew($jd, false, false, false);
$ours = strtr($ours, array($jewish::GERESH => '\'', $jewish::GERSHAYIM => '"'));
$ours .= bin2hex($ours);
$theirs = \jdtojewish($jd, true);
$theirs = mb_convert_encoding($theirs, 'UTF-8', 'ISO-8859-8');
$theirs .= bin2hex($theirs);
$this->assertSame($ours, $theirs);
}
}
Expand Down

0 comments on commit 63cd5df

Please sign in to comment.