diff options
author | Scott <scott@paragonie.com> | 2016-10-09 16:59:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-09 16:59:58 -0400 |
commit | aa342bff0f39b72da79b62b72d95a9bb86aa80b9 (patch) | |
tree | 8308ee54a479dc870c52a7ae964223b6a8b44298 | |
parent | 996354fc54e6a1d33b290db03c61f64f347c5172 (diff) | |
download | constant_time_encoding-aa342bff0f39b72da79b62b72d95a9bb86aa80b9.zip constant_time_encoding-aa342bff0f39b72da79b62b72d95a9bb86aa80b9.tar.gz constant_time_encoding-aa342bff0f39b72da79b62b72d95a9bb86aa80b9.tar.bz2 |
Remove PHP 5.3 hacks
-rw-r--r-- | src/Binary.php | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/Binary.php b/src/Binary.php index 1028e66..03476db 100644 --- a/src/Binary.php +++ b/src/Binary.php @@ -70,15 +70,6 @@ abstract class Binary $length = null ): string { if (\function_exists('mb_substr')) { - // mb_substr($str, 0, NULL, '8bit') returns an empty string on PHP - // 5.3, so we have to find the length ourselves. - if ($length === null) { - if ($start >= 0) { - $length = self::safeStrlen($str) - $start; - } else { - $length = -$start; - } - } // $length calculation above might result in a 0-length string if ($length === 0) { return ''; @@ -95,4 +86,4 @@ abstract class Binary return \substr($str, $start); } } -}
\ No newline at end of file +} |