Skip to content

Commit

Permalink
iconv_substr changed since 7.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheng SHAO committed Dec 9, 2016
1 parent 0830b86 commit 4c6400a
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions library/Zend/Locale/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,12 @@ private static function _parseDate($date, $options)
$result['day'] = $splitted[0][$cnt];
}
} else {
$result['day'] = iconv_substr($splitted[0][0], $split, 2);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['day'] = false;
} else {
$result['day'] = iconv_substr($splitted[0][0], $split, 2);
}
$split += 2;
}
++$cnt;
Expand All @@ -936,7 +941,12 @@ private static function _parseDate($date, $options)
$result['month'] = $splitted[0][$cnt];
}
} else {
$result['month'] = iconv_substr($splitted[0][0], $split, 2);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['month'] = false;
} else {
$result['month'] = iconv_substr($splitted[0][0], $split, 2);
}
$split += 2;
}
++$cnt;
Expand All @@ -953,7 +963,12 @@ private static function _parseDate($date, $options)
$result['year'] = $splitted[0][$cnt];
}
} else {
$result['year'] = iconv_substr($splitted[0][0], $split, $length);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['year'] = false;
} else {
$result['year'] = iconv_substr($splitted[0][0], $split, $length);
}
$split += $length;
}

Expand All @@ -965,7 +980,12 @@ private static function _parseDate($date, $options)
$result['hour'] = $splitted[0][$cnt];
}
} else {
$result['hour'] = iconv_substr($splitted[0][0], $split, 2);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['hour'] = false;
} else {
$result['hour'] = iconv_substr($splitted[0][0], $split, 2);
}
$split += 2;
}
++$cnt;
Expand All @@ -976,7 +996,12 @@ private static function _parseDate($date, $options)
$result['minute'] = $splitted[0][$cnt];
}
} else {
$result['minute'] = iconv_substr($splitted[0][0], $split, 2);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['minute'] = false;
} else {
$result['minute'] = iconv_substr($splitted[0][0], $split, 2);
}
$split += 2;
}
++$cnt;
Expand All @@ -987,7 +1012,12 @@ private static function _parseDate($date, $options)
$result['second'] = $splitted[0][$cnt];
}
} else {
$result['second'] = iconv_substr($splitted[0][0], $split, 2);
/* iconv_substr changes since 7.0.11 */
if (iconv_strlen($splitted[0][0]) === $split) {
$result['second'] = false;
} else {
$result['second'] = iconv_substr($splitted[0][0], $split, 2);
}
$split += 2;
}
++$cnt;
Expand Down

0 comments on commit 4c6400a

Please sign in to comment.