projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the Search API Synonym module to deal specifically with licence and license...
[yaffs-website]
/
vendor
/
paragonie
/
random_compat
/
lib
/
byte_safe_strings.php
diff --git
a/vendor/paragonie/random_compat/lib/byte_safe_strings.php
b/vendor/paragonie/random_compat/lib/byte_safe_strings.php
index 3de86b223c5b130016dee7b84055d8a0f890ca7a..ef24488f9e7bfb577456c1a010a46ecd4ecb2f6c 100644
(file)
--- a/
vendor/paragonie/random_compat/lib/byte_safe_strings.php
+++ b/
vendor/paragonie/random_compat/lib/byte_safe_strings.php
@@
-5,7
+5,7
@@
*
* The MIT License (MIT)
*
*
* The MIT License (MIT)
*
- * Copyright (c) 2015 - 201
7
Paragon Initiative Enterprises
+ * Copyright (c) 2015 - 201
8
Paragon Initiative Enterprises
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@
-28,8
+28,9
@@
if (!is_callable('RandomCompat_strlen')) {
if (
if (!is_callable('RandomCompat_strlen')) {
if (
- defined('MB_OVERLOAD_STRING') &&
- ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING
+ defined('MB_OVERLOAD_STRING')
+ &&
+ ((int) ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING
) {
/**
* strlen() implementation that isn't brittle to mbstring.func_overload
) {
/**
* strlen() implementation that isn't brittle to mbstring.func_overload
@@
-82,8
+83,8
@@
if (!is_callable('RandomCompat_substr')) {
if (
defined('MB_OVERLOAD_STRING')
if (
defined('MB_OVERLOAD_STRING')
- &&
-
ini_get('mbstring.func_overload'
) & MB_OVERLOAD_STRING
+
&&
+
((int) ini_get('mbstring.func_overload')
) & MB_OVERLOAD_STRING
) {
/**
* substr() implementation that isn't brittle to mbstring.func_overload
) {
/**
* substr() implementation that isn't brittle to mbstring.func_overload
@@
-93,7
+94,7
@@
if (!is_callable('RandomCompat_substr')) {
*
* @param string $binary_string
* @param int $start
*
* @param string $binary_string
* @param int $start
- * @param int $length (optional)
+ * @param int
|null
$length (optional)
*
* @throws TypeError
*
*
* @throws TypeError
*
@@
-118,6
+119,7
@@
if (!is_callable('RandomCompat_substr')) {
* mb_substr($str, 0, NULL, '8bit') returns an empty string on
* PHP 5.3, so we have to find the length ourselves.
*/
* mb_substr($str, 0, NULL, '8bit') returns an empty string on
* PHP 5.3, so we have to find the length ourselves.
*/
+ /** @var int $length */
$length = RandomCompat_strlen($binary_string) - $start;
} elseif (!is_int($length)) {
throw new TypeError(
$length = RandomCompat_strlen($binary_string) - $start;
} elseif (!is_int($length)) {
throw new TypeError(
@@
-133,7
+135,12
@@
if (!is_callable('RandomCompat_substr')) {
return '';
}
return '';
}
- return (string) mb_substr($binary_string, $start, $length, '8bit');
+ return (string) mb_substr(
+ (string) $binary_string,
+ (int) $start,
+ (int) $length,
+ '8bit'
+ );
}
} else {
}
} else {
@@
-145,7
+152,7
@@
if (!is_callable('RandomCompat_substr')) {
*
* @param string $binary_string
* @param int $start
*
* @param string $binary_string
* @param int $start
- * @param int $length (optional)
+ * @param int
|null
$length (optional)
*
* @throws TypeError
*
*
* @throws TypeError
*
@@
-172,10
+179,17
@@
if (!is_callable('RandomCompat_substr')) {
);
}
);
}
- return (string) substr($binary_string, $start, $length);
+ return (string) substr(
+ (string )$binary_string,
+ (int) $start,
+ (int) $length
+ );
}
}
- return (string) substr($binary_string, $start);
+ return (string) substr(
+ (string) $binary_string,
+ (int) $start
+ );
}
}
}
}
}
}