- Timestamp:
- 02/16/2022 09:17:04 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/byte_safe_strings.php
r46586 r52742 6 6 * The MIT License (MIT) 7 7 * 8 * Copyright (c) 2015 - 201 7Paragon Initiative Enterprises8 * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises 9 9 * 10 10 * Permission is hereby granted, free of charge, to any person obtaining a copy … … 29 29 if (!is_callable('RandomCompat_strlen')) { 30 30 if ( 31 defined('MB_OVERLOAD_STRING') && 32 ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING 31 defined('MB_OVERLOAD_STRING') 32 && 33 ((int) ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING 33 34 ) { 34 35 /** … … 83 84 if ( 84 85 defined('MB_OVERLOAD_STRING') 85 &&86 ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING86 && 87 ((int) ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING 87 88 ) { 88 89 /** … … 94 95 * @param string $binary_string 95 96 * @param int $start 96 * @param int $length (optional)97 * @param int|null $length (optional) 97 98 * 98 99 * @throws TypeError … … 119 120 * PHP 5.3, so we have to find the length ourselves. 120 121 */ 122 /** @var int $length */ 121 123 $length = RandomCompat_strlen($binary_string) - $start; 122 124 } elseif (!is_int($length)) { … … 134 136 } 135 137 136 return (string) mb_substr($binary_string, $start, $length, '8bit'); 138 return (string) mb_substr( 139 (string) $binary_string, 140 (int) $start, 141 (int) $length, 142 '8bit' 143 ); 137 144 } 138 145 … … 146 153 * @param string $binary_string 147 154 * @param int $start 148 * @param int $length (optional)155 * @param int|null $length (optional) 149 156 * 150 157 * @throws TypeError … … 173 180 } 174 181 175 return (string) substr($binary_string, $start, $length); 182 return (string) substr( 183 (string )$binary_string, 184 (int) $start, 185 (int) $length 186 ); 176 187 } 177 188 178 return (string) substr($binary_string, $start); 189 return (string) substr( 190 (string) $binary_string, 191 (int) $start 192 ); 179 193 } 180 194 }
Note: See TracChangeset
for help on using the changeset viewer.